Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Javascript Split vs Regex
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Mobile Safari/537.36
Browser:
Chrome Mobile 139
Operating system:
Android
Device Platform:
Mobile
Date tested:
8 months ago
Test name
Executions per second
Splitting
16826930.0 Ops/sec
Regex
5016147.5 Ops/sec
Script Preparation code:
var testString = "testing\nNewlines\nBleh"
Tests:
Splitting
var [value1, value2, value3] = testString.split("\n");
Regex
var regex = /.+((?=\n)|$)/g var [value1, value2, value3] = testString.match(regex);