Exploring JavaScript Loop Performance
2023-09-27
Introduction
Over the past while, I've been doing more and more browser-based solutions and using a ton of JavaScript along the way. Something that I've noticed is the vast difference in performance of various JavaScript loop methods. Not just that, but also the impact that your browser has as well. This toy page exists to help identify potential challenges with some loop strategies.
Going loopy
Click the button to start the measurement. The tests should run in a web worker and update this page with their progress.
The current array size is: 0 elements.
- For Loop: ...ms
- While Loop: ...ms
- For In Loop: ...ms
- For Of Loop: ...ms
- For Each Loop: ...ms
Measurement status: Idle
Return to the toys index