Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
RegEx.test vs. String.includes multiple words 2
(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 words = ["fox", "dog"];
Tests:
RegEx.test
new RegExp(words.join("|")).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
42.8M/s
RegEx.test
12.8M/s
View exact numbers
Test name
Executions per second
✓
string.includes
42,806,064 Ops/sec
RegEx.test
12,763,539 Ops/sec
Related benchmarks
RegEx.test vs. String.includes vs. String.match
RegEx.test vs. String.includes vs. String.match1
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
Comments
Confirm delete:
Do you really want to delete benchmark?