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() fix
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:123.0) Gecko/20100101 Firefox/123.0
Browser:
Firefox 123
Operating system:
Linux
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
text.includes()
1568332800.0 Ops/sec
text.test()
28498808.0 Ops/sec
text.match()
12492502.0 Ops/sec
text.indexOf()
1625002752.0 Ops/sec
text.search()
19803168.0 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/).length >= 0
text.indexOf()
url.indexOf('matchthis') >= 0
text.search()
url.search('matchthis') >= 0