Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
.includes() vs .test() vs .match() vs .indexOf() vs .search()
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:78.0) Gecko/20100101 Firefox/78.0
Browser:
Firefox 78
Operating system:
Mac OS X 10.11
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
text.includes()
6003971.5 Ops/sec
text.test()
3337803.2 Ops/sec
text.match()
1557889.9 Ops/sec
text.indexOf()
6512858.0 Ops/sec
text.search()
4380614.5 Ops/sec
Script Preparation code:
var url = 'https://www.google.com/matchthis/other/args'
Tests:
text.includes()
url.includes('matchthis')
text.test()
/matchthis/.test(url)
text.match()
url.match(/matchthis/)
text.indexOf()
url.indexOf('matchthis') >= 0
text.search()
url.search('matchthis') >= 0