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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0
Browser:
Chrome 138
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
split&join
8.8M/s
replace regex
8.2M/s
replace All
5.3M/s
View exact numbers
Test name
Executions per second
✓
split&join
8,812,524 Ops/sec
replace regex
8,153,238 Ops/sec
replace All
5,344,668 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('+');