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
Jump 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
Test name
Executions per second
text.includes()
22866204.0 Ops/sec
string.match()
13144711.0 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 !==)
.includes() vs .test() vs .match() vs .indexOf()asdasd
.includes() vs .test() vs .match() vs .toLowerCase().indexOf() with non-alpha 1
.includes() vs .test() vs .match() vs .indexOf() begin
url.includes() vs .test() vs .match() vs .indexOf()
Comments
Confirm delete:
Do you really want to delete benchmark?