Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Test find vs some
(version: 1)
Benchmark.js
Comparing performance of:
find vs some
Created:
one month ago
by:
Guest
Go to the latest result
Script Preparation code:
var authRoles = [] for (var i = 0; i < 1000000; i++) { authRoles.push['ROLE_' + i] } var roles = [] for (var i = (1000000 / 2); i < 1000000; i++) { roles.push['ROLE_' + i] }
Tests:
find
var result = authRoles.find((authr) => roles.find((r) => r === authr) === undefined)
some
var result = !(roles || []).some((r) => authRoles.includes(r))
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
find
some
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one month ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/151.0.0.0 Safari/537.36
Browser/OS:
Chrome 151 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
some
163.2M/s
find
160.6M/s
View exact numbers
Test name
Executions per second
✓
some
163,175,680 Ops/sec
find
160,606,864 Ops/sec
Related benchmarks
Object.hasOwnProperty vs Object in vs Object[]
Object.hasOwnProperty vs Object in vs Object[] vs Array.indexOf vs Array.includes vs Set.has
hasOwnPropery vs Loop vs if ... in vs Object.entries
Comments
Confirm delete:
Do you really want to delete benchmark?