Tests:
Replace
Replace All
Split+Join
Replace from var
Replace all from var
Split+join from var
Replace with template literal
Split+join with template literal
Replace with regex
Rendered benchmark preparation results:
Latest run results:
Run details: (Test run date:
one year ago )
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Goanna/6.7 Firefox/128.0 PaleMoon/33.8.0
Browser/OS:
Pale Moon (Firefox Variant) 33 on Windows
View result in a separate tab
Embed
Replace with template literal
2.2M/s
Replace all from var
1.6M/s
Split+join from var
1.2M/s
Split+join with template literal
1.1M/s
Replace with regex
969K/s
View exact numbers
Test name
Executions per second
✓
Replace with template literal
2,200,713 Ops/sec
Replace
2,186,014 Ops/sec
Replace from var
2,173,808 Ops/sec
Split+Join
1,713,948 Ops/sec
Replace All
1,629,302 Ops/sec
Replace all from var
1,572,100 Ops/sec
Split+join from var
1,162,376 Ops/sec
Split+join with template literal
1,056,603 Ops/sec
Replace with regex
968,771 Ops/sec
Do you really want to delete benchmark?