Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Test map function for object list with direct call using key vs destructured key
(version: 1)
Comparing performance of:
Test direct call from object vs Test destructured call from object list
Created:
11 months ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
var objList = [...new Array(50)].map((_, i) => ({ [`key${i+1}`]: `${Math.random() * i}`, foo: `bar-${Math.random() * i}` }));
Tests:
Test direct call from object
objList.map((t) => t.foo);
Test destructured call from object list
objList.map(({ foo }) => foo);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Test direct call from object
Test destructured call from object list
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
11 months ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36
Browser/OS:
Chrome 135 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Test direct call from object
3604757.8 Ops/sec
Test destructured call from object list
3528395.0 Ops/sec
Related benchmarks:
10k: Test Object.values vs array map for creating object array list
10k: Test Object.values vs array map for creating object array list v2
Object keys vs Array map v2
Large Map vs Object 2
map vs object - key access
Iterate keys Object vs Map
Object.entries VS Object.keys with obj[key]
Map() vs Object() on write
MapBy reduce vs foreach
Comments
Confirm delete:
Do you really want to delete benchmark?