Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
JavaScript string split vs match using regex
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/124.0.0.0 YaBrowser/24.6.0.0 Safari/537.36
Browser:
Yandex Browser 24
Operating system:
Windows
Device Platform:
Desktop
Date tested:
2 years ago
Benchmark engine:
Benchmark.js
split
2.9M/s
match
2.5M/s
View exact numbers
Test name
Executions per second
✓
split
2,894,750 Ops/sec
match
2,518,115 Ops/sec
Script Preparation code:
string = "This benchmark is testing if split or match is faster on a string using regex"; regex = /\S+/gi;
Tests:
split
string.split(regex)
match
string.match(regex)