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
one month ago
Test name Executions per second
for loop 12994876.0 Ops/sec
Array.prototype.reduce.call 1691705.8 Ops/sec
String.prototype.reduce 1761112.1 Ops/sec
Array.prototype.forEach 1663619.9 Ops/sec
.split.reduce 10024921.0 Ops/sec
.split.forEach 8935861.0 Ops/sec
for loop with charCodeAt 15719678.0 Ops/sec
Script Preparation code:
Tests:
  • for loop

  • Array.prototype.reduce.call

  • String.prototype.reduce

  • Array.prototype.forEach

  • .split.reduce

  • .split.forEach

  • for loop with charCodeAt