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 (X11; Ubuntu; Linux x86_64; rv:124.0) Gecko/20100101 Firefox/124.0
Browser:
Firefox 124
Operating system:
Ubuntu
Device Platform:
Desktop
Date tested:
2 years ago
replaceAll (string)
16.6M/s
replace
11.0M/s
replaceAll (regex)
8.8M/s
View exact numbers
Test name
Executions per second
✓
replaceAll (string)
16,604,050 Ops/sec
replace
11,036,479 Ops/sec
replaceAll (regex)
8,762,646 Ops/sec
Tests:
replace
"this is it".replace(/ /g, "+");
replaceAll (regex)
"this is it".replaceAll(/ /g, "+");
replaceAll (string)
"this is it".replaceAll(" ", "+");