Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
[STRING] IndexOf vs Includes
simple sample to test perf
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Android 11; Mobile; rv:146.0) Gecko/146.0 Firefox/146.0
Browser:
Firefox Mobile 146
Operating system:
Android
Device Platform:
Mobile
Date tested:
4 months ago
Test name
Executions per second
IndexOf
535455072.0 Ops/sec
Includes
534847488.0 Ops/sec
Script Preparation code:
var string = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.'
Tests:
IndexOf
string.indexOf('tempor') >= 0 string.indexOf('123') >= 0
Includes
string.includes('tempor') string.includes('123')