Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
is find arrays cached
(version: 0)
Comparing performance of:
single find (500) vs double same find (500) vs double different find (500) vs single find (100) vs double same find (100) vs double different find (100)
Created:
4 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var data = Array(1000).fill().map((_, id) => ({ id, name: `${id}_name` })); var data2 = Array(1000).fill().map((_, id) => ({ id, name: `${id}_name` }));
Tests:
single find (500)
const found = data.find((item) => item.id === 500); const result = { id: found?.id, name: found?.name, };
double same find (500)
const result = { id: data.find((item) => item.id === 500)?.id, name: data.find((item) => item.id === 500)?.name, };
double different find (500)
const result = { id: data.find((item) => item.id === 500)?.id, name: data2.find((item) => item.id === 500)?.name, };
single find (100)
const found = data.find((item) => item.id === 100); const result = { id: found?.id, name: found?.name, }
double same find (100)
const result = { id: data.find((item) => item.id === 100)?.id, name: data.find((item) => item.id === 100)?.name, };
double different find (100)
const result = { id: data.find((item) => item.id === 100)?.id, name: data2.find((item) => item.id === 100)?.name, };
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (6)
Previous results
Fork
Test case name
Result
single find (500)
double same find (500)
double different find (500)
single find (100)
double same find (100)
double different find (100)
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
Search: Array to Map and find vs Array.find
is find arrays cached (es5)
Search: Array to Map and find vs Array.find685000
Search: Array to Map and find vs Array.find 2
Comments
Confirm delete:
Do you really want to delete benchmark?