Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
RegEx.test vs. String.includes multiple words
(version: 1)
Comparing performance of:
RegEx.test vs String.includes
Created:
one month ago
by:
Guest
Go to the latest result
Script Preparation code:
var string = "The quick brown fox jumps over the lazy dog."; var regex = /fox|dog/; var words = ["fox", "dog"];
Tests:
RegEx.test
regex.test(string);
String.includes
words.some(word => string.includes(word));
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
RegEx.test
String.includes
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one month ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:151.0) Gecko/20100101 Firefox/151.0
Browser/OS:
Firefox 151 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
String.includes
661.2M/s
RegEx.test
57.6M/s
View exact numbers
Test name
Executions per second
✓
String.includes
661,178,752 Ops/sec
RegEx.test
57,583,764 Ops/sec
Related benchmarks
RegEx.test vs. String.includes vs. String.match
Long regex test vs string includes
Longer regex test vs string includes
RegEx.test vs. String.includes x 2
RegEx.test vs. String.includes multiple words 2
Comments
Confirm delete:
Do you really want to delete benchmark?