Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
IndexOf comparison vs Includes in string
(version: 1)
Banana
Comparing performance of:
IndexOf vs Includes
Created:
one year ago
by:
Guest
Jump to the latest result
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') !== -1
Includes
string.includes('tempor')
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
IndexOf
Includes
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
5 months ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36 Edg/142.0.0.0
Browser/OS:
Chrome 142 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
IndexOf
206297248.0 Ops/sec
Includes
204026176.0 Ops/sec
Related benchmarks:
IndexOf vs Includes in string
IndexOf vs Includes in string 233
IndexOf vs Includes in string 333
IndexOf === -1 vs Includes in string
IndexOf vs Includes in string tedt
IndexOf vs Includes in string with check
IndexOf > -1 vs Includes in string
IndexOf vs Includes in string as boolean
String.indexOf > -1 vs String.includes
IndexOf vs Includes in string 2
Comments
Confirm delete:
Do you really want to delete benchmark?