Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
.includes() vs .match()
(version: 1)
Compare different intra-string matching styles
Comparing performance of:
text.includes() vs string.match()
Created:
one year ago
by:
Guest
Go to the latest result
Script Preparation code:
var url='https://www.google.com/matchthis/other/args'
Tests:
text.includes()
url.includes('matchthis') && url.includes('-matchthis')
string.match()
url.match(/(?<!-)matchthis/)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
text.includes()
string.match()
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36
Browser/OS:
Chrome 132 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
text.includes()
22.9M/s
string.match()
13.1M/s
View exact numbers
Test name
Executions per second
✓
text.includes()
22,866,204 Ops/sec
string.match()
13,144,711 Ops/sec
Related benchmarks
.includes() vs .test() vs .match() vs .indexOf()
.includes() vs .test() vs .match() vs .indexOf() vs .search()
.includes() vs .test() vs .match() vs .indexOf() vs .search() fix
.includes() vs .test() vs .replace() vs .indexOf()
.includes() vs .test() vs .match() vs .indexOf() (w/ -1 != and !==)
url.includes() vs .test() vs .match() vs .indexOf()
Comments
Confirm delete:
Do you really want to delete benchmark?