Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
replace vs replaceAll (native)
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:152.0) Gecko/20100101 Firefox/152.0
Browser:
Firefox 152
Operating system:
Mac OS X 10.15
Device Platform:
Desktop
Date tested:
one month ago
replaceAll (string)
19.2M/s
replace
8.9M/s
replaceAll (regex)
8.6M/s
View exact numbers
Test name
Executions per second
✓
replaceAll (string)
19,210,078 Ops/sec
replace
8,947,965 Ops/sec
replaceAll (regex)
8,558,692 Ops/sec
Tests:
replace
"this is it".replace(/ /g, "+");
replaceAll (regex)
"this is it".replaceAll(/ /g, "+");
replaceAll (string)
"this is it".replaceAll(" ", "+");