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:
10 days ago
by:
Guest
Jump 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:
10 days 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
Test name
Executions per second
RegEx.test
12763539.0 Ops/sec
string.includes
42806064.0 Ops/sec
Related benchmarks:
RegEx.test vs. String.includes vs. String.match
RegEx.test vs String.includes
RegEx.test vs. String.includes vs. String.match (multiple words in regex)
RegEx.test vs. String.includes vs. String.match1
RegEx.test vs. String.includes vs. String.match(Regex)
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?