Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Chrome 121
Linux
Desktop
2 years ago
Benchmark.js
replace regex with repetition
6.3M/s
replace regex without repetition
6.1M/s
replaceAll
5.8M/s
View exact numbers
Test name Executions per second
replace regex with repetition 6,325,896 Ops/sec
replace regex without repetition 6,121,640 Ops/sec
replaceAll 5,756,042 Ops/sec
Tests: