Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Test indexOf vs FindIndex vs include v2
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36
Browser:
Chrome 128
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Index Of
1.1M/s
Includes
1.1M/s
Includes last
610K/s
Index Of last
596K/s
Find Index
4K/s
Find Index last
2K/s
View exact numbers
Test name
Executions per second
✓
Index Of
1,113,914 Ops/sec
Includes
1,090,453 Ops/sec
Includes last
610,302 Ops/sec
Index Of last
595,660 Ops/sec
Find Index
3,816 Ops/sec
Find Index last
1,867 Ops/sec
Script Preparation code:
var bigIdList = new Array(15000); bigIdList.fill({ id: 0 }); bigIdList = bigIdList.map((el) => el.id = Math.floor(Math.random() * 15000)) var test = 7500 var last = 15000
Tests:
Index Of
bigIdList.indexOf(test) !== -1
Find Index
bigIdList.findIndex((item) => item === test)
Includes
bigIdList.includes(test)
Index Of last
bigIdList.indexOf(last) !== -1
Find Index last
bigIdList.findIndex((item) => item === last)
Includes last
bigIdList.includes(last)