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 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0
Browser:
Firefox 128
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Includes
1800.4M/s
IndexOf
1527.8M/s
View exact numbers
Test name
Executions per second
✓
Includes
1,800,419,584 Ops/sec
IndexOf
1,527,778,304 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')