Script Preparation code:
AخA
 
const text = new Array(2000000).fill("a").join("");
Tests:
  • for

     
    const text = new Array(2000000).fill("a").join("");
    const string = new Array(text.length);
    for (let i = 0; i < text.length; i++) {
      string[i] = text[i];
    }
  • for ... of

     
    const text = new Array(2000000).fill("a").join("");
    const string = [];
    for (const char of text) {
      string.push(char);
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    for
    for ... of

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36
Chrome 103 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
for 24.1 Ops/sec
for ... of 15.8 Ops/sec