Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36
Chrome 146
Windows
Desktop
4 months ago
for loop with charCodeAt
15.7M/s
for loop
13.0M/s
.split.reduce
10.0M/s
.split.forEach
8.9M/s
String.prototype.reduce
1.8M/s
Array.prototype.reduce.call
1.7M/s
Array.prototype.forEach
1.7M/s
View exact numbers
Test name Executions per second
for loop with charCodeAt 15,719,678 Ops/sec
for loop 12,994,876 Ops/sec
.split.reduce 10,024,921 Ops/sec
.split.forEach 8,935,861 Ops/sec
String.prototype.reduce 1,761,112 Ops/sec
Array.prototype.reduce.call 1,691,706 Ops/sec
Array.prototype.forEach 1,663,620 Ops/sec
Script Preparation code:
Tests: