![]() ![]() ![]() The while loop with decrements was approximately 1.5 times slower than the for loop.(The for loop with cached length sometimes delivered better results than the one without caching, but the difference is almost negligible, which means the engine might be already optimized to favor the standard and probably most straightforward for loop without caching). The fastest loop is a for loop, both with and without caching length delivering really similar performance.As of June 2016, doing some tests in latest Chrome (71% of the browser market in May 2016, and increasing):
0 Comments
Leave a Reply. |