Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36
Chrome 127
Linux
Desktop
one year ago
replace inline regex
7.2M/s
substr and substr (legacy)
6.8M/s
substring and slice
6.8M/s
brackets and substr (legacy)
6.7M/s
brackets and substring
6.7M/s
substring and substring
6.7M/s
brackets and slice
6.6M/s
replace compiled regex var
5.5M/s
View exact numbers
Test name Executions per second
replace inline regex 7,215,240 Ops/sec
substr and substr (legacy) 6,818,512 Ops/sec
substring and slice 6,758,788 Ops/sec
brackets and substr (legacy) 6,744,650 Ops/sec
brackets and substring 6,734,483 Ops/sec
substring and substring 6,689,648 Ops/sec
brackets and slice 6,626,578 Ops/sec
replace compiled regex var 5,535,254 Ops/sec
Script Preparation code:
Tests: