Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
RegEx.test vs. multiple includes
(version: 1)
Comparing performance of:
RegEx.test vs String.includes
Created:
8 months ago
by:
Guest
Go to the latest result
Script Preparation code:
const string = 'Hello world!' const searchA = 'Hello' const searchB = 'world' const regex = /Hello|world/;
Tests:
RegEx.test
regex.test(string)
String.includes
string.includes(searchA) string.includes(searchB)
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:
8 months ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:146.0) Gecko/20100101 Firefox/146.0
Browser/OS:
Firefox 146 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
String.includes
918.6M/s
RegEx.test
45.6M/s
View exact numbers
Test name
Executions per second
✓
String.includes
918,629,504 Ops/sec
RegEx.test
45,569,524 Ops/sec
Related benchmarks
RegEx.test vs. String.includes vs. String.match
RegEx.test vs String.includes vs String.indexOf
RegEx.test vs. String.includes vs. String.match insensitive
RegEx.test (with inline regex) vs. String.includes vs. String.match
Long regex test vs string includes
Longer regex test vs string includes
Comments
Confirm delete:
Do you really want to delete benchmark?