Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
split & join vs replace
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/118.0.0.0 Safari/537.36
Browser:
Chrome 118
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
replace
5.7M/s
split & join
4.7M/s
View exact numbers
Test name
Executions per second
✓
replace
5,733,308 Ops/sec
split & join
4,658,516 Ops/sec
Script Preparation code:
const address = '10 Downing Street,London,UK,SW10'
Tests:
split & join
address.split(',').join(', ')
replace
address.replace(/,/g, ', ')