Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
Chrome 129
Windows
Desktop
one year ago
replace inline regex
4.8M/s
brackets and slice
4.6M/s
brackets and substr (legacy)
4.6M/s
substr and substr (legacy)
4.6M/s
substring and slice
4.6M/s
brackets and substring
4.5M/s
substring and substring
4.5M/s
replace compiled regex var
3.8M/s
View exact numbers
Test name Executions per second
replace inline regex 4,765,441 Ops/sec
brackets and slice 4,630,269 Ops/sec
brackets and substr (legacy) 4,602,836 Ops/sec
substr and substr (legacy) 4,589,143 Ops/sec
substring and slice 4,570,434 Ops/sec
brackets and substring 4,532,971 Ops/sec
substring and substring 4,517,682 Ops/sec
replace compiled regex var 3,791,698 Ops/sec
Script Preparation code:
Tests: