find() vs indexOf() vs for...of vs for-loop - bigger array (version: 8)
Testing the difference between native loops and find() with a bigger array of 10,001 elements :)
Fixed bug in the original test forked from: https://www.measurethat.net/Benchmarks/Show/4261/0/find-vs-forof-vs-for-loop
(node.id is undefined in find() test)
Comparing performance of: for-loop vs for..of vs Array.find() vs indexOf
Memory measurements supported only in Chrome.
For precise memory measurements Chrome must be launched with --enable-precise-memory-info flag.
More information: Monitoring JavaScript Memory
Test case name
Result
for-loop
for..of
Array.find()
indexOf
Fastest:N/A
Slowest:N/A
Latest run results:
Run details: (Test run date:
5 months ago)
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36