HTML Preparation code:
Script Preparation code:
Tests:

Historical Performance Data aggregated from 6 community runs

Desktop Results:
Chrome 6 runs
for
390/s
jQuery.each
333/s
NodeList.forEach
311/s
Array.forEach
271/s
for..of
263/s

Fastest: for (1.5x faster)

View exact numbers
  • for: 390 ops/sec
  • jQuery.each: 333 ops/sec
  • NodeList.forEach: 311 ops/sec
  • Array.forEach: 271 ops/sec
  • for..of: 263 ops/sec

Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    for
    for..of
    NodeList.forEach
    Array.forEach
    jQuery.each

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one month ago)
Mozilla/5.0 (X11; Linux x86_64; rv:152.0) Gecko/20100101 Firefox/152.0
Firefox 152 on Linux
View result in a separate tab
jQuery.each
497/s
Array.forEach
481/s
NodeList.forEach
441/s
for..of
435/s
for
405/s
View exact numbers
Test name Executions per second
jQuery.each 497 Ops/sec
Array.forEach 481 Ops/sec
NodeList.forEach 441 Ops/sec
for..of 435 Ops/sec
for 405 Ops/sec