Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
test of find
(version: 1)
Comparing performance of:
find vs dict
Created:
one year ago
by:
Guest
Jump to the latest result
Script Preparation code:
var myArr = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']; var myDict = _.keyBy(myArr);
Tests:
find
if (myArray.find("m")) { console.log("array has 'm'"); }
dict
if (myDict['m']) { console.log("dict has 'm'"); }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
find
dict
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Browser/OS:
Chrome 130 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
find
0.0 Ops/sec
dict
629400.1 Ops/sec
Related benchmarks:
object read vs write
every vs for
every vs for 2
for in vs iterate over keys
Get length of arr vs obj
UINT32Array
array = [] vs array.length = 0
keys vs new array
test dict find
Comments
Confirm delete:
Do you really want to delete benchmark?