Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
replace vs. slice
Cut first char from string.
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Linux; arm_64; Android 12; 2207117BPG) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 YaApp_Android/23.30.1 YaSearchBrowser/23.30.1 BroPP/1.0 SA/3 Mobile Safari/537.36
Browser:
Chrome 110
Operating system:
Android 23.30.1
Device Platform:
Mobile
Date tested:
2 years ago
Test name
Executions per second
replace
396408.0 Ops/sec
slice
1333059.1 Ops/sec
Script Preparation code:
var strIn = '#hash'; var strOut = '';
Tests:
replace
strOut = strIn.replace('#', '');
slice
strOut = strIn.slice(1);