Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Chrome 131
Windows
Desktop
one year ago
for in
1.2M/s
forEach
1.2M/s
for (with defined iterator and iterator limit)
13K/s
while (with defined iterator limit)
13K/s
do while (with defined iterator limit)
13K/s
for of
12K/s
for (with defined iterator)
7K/s
for
7K/s
do while
6K/s
while
6K/s
View exact numbers
Test name Executions per second
for in 1,208,958 Ops/sec
forEach 1,154,055 Ops/sec
for (with defined iterator and iterator limit) 12,944 Ops/sec
while (with defined iterator limit) 12,895 Ops/sec
do while (with defined iterator limit) 12,749 Ops/sec
for of 11,749 Ops/sec
for (with defined iterator) 6,534 Ops/sec
for 6,509 Ops/sec
do while 6,452 Ops/sec
while 6,377 Ops/sec
Script Preparation code:
Tests: