Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
replaceAll vs replace with global
(version: 1)
Comparing performance of:
replace regex vs replace All
Created:
one year ago
by:
Guest
Jump to the latest result
Tests:
replace regex
"<CLNR><CR>光の中では見えないもの<CLNR><CR>が、暗闇の中ではよく<CR><CLGR>見える".replace(/<CLNR><CR>|<CR><CLGR>/g, "\r\n");
replace All
"<CLNR><CR>光の中では見えないもの<CLNR><CR>が、暗闇の中ではよく<CR><CLGR>見える".replaceAll(/<CLNR><CR>|<CR><CLGR>/g, "\r\n");
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
replace regex
replace All
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0
Browser/OS:
Firefox 134 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
replace regex
9322514.0 Ops/sec
replace All
7651069.0 Ops/sec
Related benchmarks:
lorem issfaacsascsafsaf
string replaceAll test
replaceAll vs naive implementation
replaceAll vs replace vs split-joinCD
Replace with charAt vs Two replaces
Regex vs split-join string performance 2
replaceAll vs replace 2
replaceAll vs regex replace for a newLine using html tags
replaceAll vs regex replace string
Comments
Confirm delete:
Do you really want to delete benchmark?