Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
(vanilla) replaceAll vs regex replace vs split&join
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:148.0) Gecko/20100101 Firefox/148.0
Browser:
Firefox 148
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one month ago
Test name
Executions per second
replace regex
2514235.8 Ops/sec
replace All
4272164.0 Ops/sec
split&join
1885869.5 Ops/sec
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('+');