Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Measure speed
(version: 1)
Comparing performance of:
match vs split
Created:
one year ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
function generateRandomString(length) { const randomValues = new Uint8Array(length); window.crypto.getRandomValues(randomValues); const randomChars = Array.from(randomValues, (value) => String.fromCharCode(value)); return randomChars.join(''); } const text = generateRandomString(1000);
Tests:
match
const numbers = text.match(/\d+/g)
split
const numbers = text.split(/\d+/g)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
match
split
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:133.0) Gecko/20100101 Firefox/133.0
Browser/OS:
Firefox 133 on Mac OS X 10.15
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
match
812197.5 Ops/sec
split
728141.4 Ops/sec
Related benchmarks:
Text.data vs Text.nodeValue
indexOf vs startsWith
.substr vs .startwith
.indexOf vs .startsWith - cccccccccccccccccccc
Split vs Spread (randomized)
RW - test
generateRandomString
String character looping
Test for numbers
Comments
Confirm delete:
Do you really want to delete benchmark?