Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
object key vs array find
(version: 3)
Comparing performance of:
object key vs array find
Created:
one year ago
by:
Registered User
Jump to the latest result
Script Preparation code:
var itemKey = 100; var objContainer = {}; var arrContainer = []; for (let i = 1; i <= 100000; i++) { objContainer[i.toString()] = i; arrContainer.push(i); }
Tests:
object key
objContainer[itemKey];
array find
arrContainer.find(containerItem => containerItem === itemKey);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
object key
array find
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Mobile Safari/537.36
Browser/OS:
Chrome Mobile 136 on Android
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
object key
103345264.0 Ops/sec
array find
15573401.0 Ops/sec
Related benchmarks:
Object key access vs array find2
Object key access vs array find vs map
Object key access vs array find 100 items yeh ok
Object key access vs array find vs Set
Comments
Confirm delete:
Do you really want to delete benchmark?