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 without repetition
6.2M/s
replace regex with repetition
6.1M/s
replaceAll
5.7M/s
View exact numbers
Test name Executions per second
replace regex without repetition 6,172,762 Ops/sec
replace regex with repetition 6,092,052 Ops/sec
replaceAll 5,686,480 Ops/sec
Tests: