Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Chrome 120
Windows
Desktop
2 years ago
match without replace
1K/s
ES5 replace match map
908/s
iteration with replace
875/s
View exact numbers
| Test name |
Executions per second |
|
✓
non regex
|
6,506 Ops/sec |
|
original
|
2,551 Ops/sec |
|
looping with exec
|
1,476 Ops/sec |
|
match without replace
|
1,399 Ops/sec |
|
ES5 replace match map
|
908 Ops/sec |
|
iteration with replace
|
875 Ops/sec |
Tests:
-
original
-
ES5 replace match map
-
match without replace
-
iteration with replace
-
looping with exec
-
non regex