Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Safari/605.1.15
Safari 17
Mac OS X 10.15.7
Desktop
2 years ago
match without replace
2K/s
ES5 replace match map
1K/s
iteration with replace
1K/s
View exact numbers
| Test name |
Executions per second |
|
✓
non regex
|
10,197 Ops/sec |
|
original
|
2,281 Ops/sec |
|
match without replace
|
2,109 Ops/sec |
|
looping with exec
|
1,579 Ops/sec |
|
ES5 replace match map
|
1,231 Ops/sec |
|
iteration with replace
|
1,084 Ops/sec |
Tests:
-
original
-
ES5 replace match map
-
match without replace
-
iteration with replace
-
looping with exec
-
non regex