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:
7 months ago
IndexOf
535.5M/s
Includes
534.8M/s
View exact numbers
Test name
Executions per second
✓
IndexOf
535,455,072 Ops/sec
Includes
534,847,488 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')