Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
replaceAll vs regex replace g
(version: 1)
Comparing performance of:
replace regex vs replace All vs split&join
Created:
one year ago
by:
Guest
Jump to the latest result
Tests:
replace regex
"this {a} is {a} it".replace(/\{a\}/g, "+");
replace All
"this {a} is {a} it".replaceAll("{a}", "+");
split&join
"this {a} is {a} it".split('{a}').join('+');
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
replace regex
replace All
split&join
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:136.0) Gecko/20100101 Firefox/136.0
Browser/OS:
Firefox 136 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
replace regex
4995415.0 Ops/sec
replace All
9734111.0 Ops/sec
split&join
4384561.5 Ops/sec
Comments
Confirm delete:
Do you really want to delete benchmark?