Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Find words in sentence via Regex.test vs Array.some vs String.match
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (iPhone; CPU iPhone OS 27_0_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/150.0.7871.113 Mobile/15E148 Safari/604.1
Browser:
Chrome Mobile iOS 150
Operating system:
iOS 27.0.0
Device Platform:
Mobile
Date tested:
20 days ago
Regex.test
985.9M/s
String.match
841.9M/s
Array.some
9.5M/s
View exact numbers
Test name
Executions per second
✓
Regex.test
985,911,744 Ops/sec
String.match
841,933,952 Ops/sec
Array.some
9,533,429 Ops/sec
Script Preparation code:
const searchWordsArray = ["Hello", "array", "some", "name", "you", "benchmark"]; const searchWordsRegex = /Hello|array|some|name|you|benchmark/; const sentence = "This sentence has one of the searched words at the end of the sentence, to get a more meaningful result in this benchmark."
Tests:
Regex.test
searchWordsRegex.test(sentence);
Array.some
searchWordsArray.some((word) => sentence.includes(word));
String.match
sentence.match(searchWordsRegex);