Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
String replace using regex vs string
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Android 12; Mobile; rv:135.0) Gecko/135.0 Firefox/135.0
Browser:
Firefox Mobile 135
Operating system:
Android
Device Platform:
Mobile
Date tested:
one year ago
Test name
Executions per second
replace by regex
3525309.2 Ops/sec
replace via string
2170886.5 Ops/sec
Script Preparation code:
var string = '-firstDeadlineReminderData__PS__assignment__PS__perEntityType__PS__Applicant__PS__hasDeadline' var regExp = new RegExp('__PS__', 'g');
Tests:
replace by regex
var res = string.replace(regExp, '.')
replace via string
var res = string.split('__PS__').join('.');