Script Preparation code:
AخA
 
var strTxt = Array(100000).fill("@".repeat(128)).join(" "), len = 2;
Tests:
  • testttttt

     
    var ar = strTxt.matchAll(new RegExp('.{1,'+len+'}','g'));
    console.log(ar.next().value[0]);
  • tesstttt2

     
    var ar = [];
    for(i=0,y=0;i<Math.ceil(strTxt.length/len);i++,y=i*len){
        ar[i] = strTxt.slice(y,y+len);
        
    }
    console.log(ar[0]);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    testttttt
    tesstttt2

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 years ago)
Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36
Chrome 85 on Windows 7
View result in a separate tab
Test name Executions per second
testttttt 66129.2 Ops/sec
tesstttt2 0.1 Ops/sec