Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
replace w/ RegExp vs replaceAll
(version: 1)
Comparing performance of:
replace vs replace w/ RegExp vs replaceAll
Created:
one year ago
by:
Guest
Jump to the latest result
Script Preparation code:
const regex = new RegExp(" ", "g");
Tests:
replace
"Just checking some more things".replace(/ /g, "-");
replace w/ RegExp
"Just checking some more things".replace(regex, "-");
replaceAll
"Just checking some more things".replaceAll(" ", "-");
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
replace
replace w/ RegExp
replaceAll
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Comments
Confirm delete:
Do you really want to delete benchmark?