Array.find vs map to object then lookup. (version: 10)
For an array of objects, is multiple calls to Array.find performant?
Can we improve find performance by first creating a flat array of just the object keys we are looking for, then calling Array.includes?
Comparing performance of: find value in the array each time vs lookup the value
Memory measurements supported only in Chrome.
For precise memory measurements Chrome must be launched with --enable-precise-memory-info flag.
More information: Monitoring JavaScript Memory
Test case name
Result
find value in the array each time
lookup the value
Fastest:N/A
Slowest:N/A
Latest run results:
Run details: (Test run date:
3 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:92.0) Gecko/20100101 Firefox/92.0