Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Split vs Substring + IndexOf
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36
Browser:
Chrome 137
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
9 months ago
Test name
Executions per second
Split
745.0 Ops/sec
Substring
713.2 Ops/sec
HTML Preparation code:
<div id='xx'></div>
Script Preparation code:
let email = 'TestUser2137@example.com'; let times = 1000;
Tests:
Split
let x = 0; while (x < times) { const userName = email.split('@')[0]; console.log(userName); x += 1; }
Substring
let x = 0; while (x < times) { const userName = email.substring(0, email.indexOf('@')); console.log(userName); x += 1; }