Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
binary id find vs lodash id find
(version: 0)
Comparing performance of:
lodash find vs binary find
Created:
7 years ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
Tests:
lodash find
var a = [ { "_id": "5c0fea04038925734b19f8cf", "index": 0, "guid": "e4c731c6-ddb0-4a42-8de3-9fd3a006289d", "isActive": false, "balance": "$2,711.11", "picture": "http://placehold.it/32x32", "age": 22, "eyeColor": "green", "name": { "first": "Mamie", "last": "Cline" }, "company": "PREMIANT", "email": "mamie.cline@premiant.me", "phone": "+1 (869) 472-2486", "address": "703 Cheever Place, Kingstowne, Louisiana, 7904", "about": "Aliquip aliqua ea ad id occaecat ad dolor proident. Labore ad pariatur velit ullamco dolor consequat aliqua et ut consectetur. Adipisicing incididunt incididunt velit exercitation adipisicing reprehenderit fugiat esse aliquip.", "registered": "Tuesday, January 2, 2018 7:28 PM", "latitude": "57.698866", "longitude": "127.045331", "tags": [ "nulla", "officia", "commodo", "reprehenderit", "ullamco" ], "range": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ], "friends": [ { "id": 0, "name": "Beth Salas" }, { "id": 1, "name": "Harvey Bray" }, { "id": 2, "name": "Vera Mcbride" } ], "greeting": "Hello, Mamie! You have 9 unread messages.", "favoriteFruit": "strawberry" }, { "_id": "5c0fea049b9f9b04d1440fc1", "index": 1, "guid": "5f76f02a-703e-4412-be93-bc27fc2ec263", "isActive": false, "balance": "$3,312.78", "picture": "http://placehold.it/32x32", "age": 21, "eyeColor": "blue", "name": { "first": "Larson", "last": "Navarro" }, "company": "ULTRIMAX", "email": "larson.navarro@ultrimax.ca", "phone": "+1 (832) 452-3058", "address": "711 Wakeman Place, Shelby, Tennessee, 3886", "about": "Enim sunt nulla tempor occaecat id Lorem. Cupidatat do non ex quis exercitation. Veniam nisi qui est consequat et id culpa duis ipsum consectetur duis. Enim ex reprehenderit ipsum et laboris veniam. Sunt dolore do culpa Lorem cupidatat. Qui sit amet adipisicing tempor occaecat velit nulla eu magna culpa est fugiat. Anim magna occaecat veniam nostrud dolore duis minim amet.", "registered": "Sunday, May 6, 2018 1:06 PM", "latitude": "-18.778754", "longitude": "-14.150211", "tags": [ "occaecat", "tempor", "reprehenderit", "fugiat", "velit" ], "range": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ], "friends": [ { "id": 0, "name": "Lucy Mckay" }, { "id": 1, "name": "Lou Wolf" }, { "id": 2, "name": "Shaffer Pace" } ], "greeting": "Hello, Larson! You have 9 unread messages.", "favoriteFruit": "strawberry" }, { "_id": "5c0fea04b4246cf9b05dee4a", "index": 2, "guid": "0f5b0817-9dee-4470-978e-1e57d60d870f", "isActive": true, "balance": "$2,126.57", "picture": "http://placehold.it/32x32", "age": 30, "eyeColor": "brown", "name": { "first": "Dawson", "last": "Campbell" }, "company": "MYOPIUM", "email": "dawson.campbell@myopium.co.uk", "phone": "+1 (898) 552-3452", "address": "497 Irving Place, Magnolia, Vermont, 771", "about": "Eiusmod aliquip mollit ut anim minim amet veniam aute duis ex quis ad non sint. Non tempor eu officia aliqua cillum non voluptate eu exercitation qui fugiat irure consectetur sint. Eu quis proident do deserunt sunt fugiat et voluptate voluptate Lorem minim laboris excepteur nisi. Nisi incididunt laboris ullamco elit nulla enim occaecat minim. Fugiat cillum Lorem id incididunt tempor occaecat mollit excepteur. Eu aliquip aliquip qui duis officia laborum mollit.", "registered": "Saturday, November 21, 2015 12:01 PM", "latitude": "-83.798612", "longitude": "162.071891", "tags": [ "officia", "adipisicing", "aliquip", "esse", "Lorem" ], "range": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ], "friends": [ { "id": 0, "name": "Parker Clay" }, { "id": 1, "name": "Bowman Pacheco" }, { "id": 2, "name": "Lynne Madden" } ], "greeting": "Hello, Dawson! You have 9 unread messages.", "favoriteFruit": "strawberry" }, { "_id": "5c0fea04968b0f6c04459798", "index": 3, "guid": "83712f13-dab3-479e-b008-a686c713f656", "isActive": false, "balance": "$1,140.05", "picture": "http://placehold.it/32x32", "age": 26, "eyeColor": "blue", "name": { "first": "Moon", "last": "Mills" }, "company": "SCENTY", "email": "moon.mills@scenty.org", "phone": "+1 (855) 585-2051", "address": "976 Greene Avenue, Lafferty, Wisconsin, 8809", "about": "Lorem consectetur eiusmod labore nulla amet in Lorem nulla deserunt veniam. Do adipisicing eu proident pariatur exercitation adipisicing laborum occaecat eu elit. In incididunt dolore mollit aliqua officia. In esse anim non duis aliqua incididunt irure tempor dolore amet mollit. Amet voluptate sint eu ullamco sunt eiusmod do adipisicing culpa culpa non cupidatat enim velit.", "registered": "Tuesday, February 25, 2014 8:03 PM", "latitude": "16.571577", "longitude": "90.155055", "tags": [ "amet", "ex", "cillum", "labore", "mollit" ], "range": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ], "friends": [ { "id": 0, "name": "Josie Mccullough" }, { "id": 1, "name": "Myrna Hendricks" }, { "id": 2, "name": "Kayla Bruce" } ], "greeting": "Hello, Moon! You have 10 unread messages.", "favoriteFruit": "banana" }, { "_id": "5c0fea044ccce300cdd7fe43", "index": 4, "guid": "edfba3b0-39e2-45f8-97bc-8ad51f0f97d7", "isActive": false, "balance": "$1,580.81", "picture": "http://placehold.it/32x32", "age": 37, "eyeColor": "brown", "name": { "first": "Mills", "last": "Carrillo" }, "company": "SLAX", "email": "mills.carrillo@slax.net", "phone": "+1 (851) 413-3414", "address": "940 Hanson Place, Soham, California, 4566", "about": "Laborum do cillum laborum consequat laboris aliquip anim aliqua voluptate ut. Amet ipsum duis sint aliquip commodo commodo elit. Enim et et laborum duis laborum deserunt labore occaecat veniam officia incididunt ullamco ipsum tempor. Commodo excepteur aliquip id ullamco cillum et.", "registered": "Saturday, March 17, 2018 12:21 AM", "latitude": "39.195963", "longitude": "126.146007", "tags": [ "laboris", "reprehenderit", "cillum", "aute", "anim" ], "range": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ], "friends": [ { "id": 0, "name": "Emerson Justice" }, { "id": 1, "name": "Lambert Mason" }, { "id": 2, "name": "Rhodes Barron" } ], "greeting": "Hello, Mills! You have 8 unread messages.", "favoriteFruit": "strawberry" } ]; var b=_.find(a, item => item._id == '5c0fea04b4246cf9b05dee4a');
binary find
var a = [ { "_id": "5c0fea04038925734b19f8cf", "index": 0, "guid": "e4c731c6-ddb0-4a42-8de3-9fd3a006289d", "isActive": false, "balance": "$2,711.11", "picture": "http://placehold.it/32x32", "age": 22, "eyeColor": "green", "name": { "first": "Mamie", "last": "Cline" }, "company": "PREMIANT", "email": "mamie.cline@premiant.me", "phone": "+1 (869) 472-2486", "address": "703 Cheever Place, Kingstowne, Louisiana, 7904", "about": "Aliquip aliqua ea ad id occaecat ad dolor proident. Labore ad pariatur velit ullamco dolor consequat aliqua et ut consectetur. Adipisicing incididunt incididunt velit exercitation adipisicing reprehenderit fugiat esse aliquip.", "registered": "Tuesday, January 2, 2018 7:28 PM", "latitude": "57.698866", "longitude": "127.045331", "tags": [ "nulla", "officia", "commodo", "reprehenderit", "ullamco" ], "range": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ], "friends": [ { "id": 0, "name": "Beth Salas" }, { "id": 1, "name": "Harvey Bray" }, { "id": 2, "name": "Vera Mcbride" } ], "greeting": "Hello, Mamie! You have 9 unread messages.", "favoriteFruit": "strawberry" }, { "_id": "5c0fea049b9f9b04d1440fc1", "index": 1, "guid": "5f76f02a-703e-4412-be93-bc27fc2ec263", "isActive": false, "balance": "$3,312.78", "picture": "http://placehold.it/32x32", "age": 21, "eyeColor": "blue", "name": { "first": "Larson", "last": "Navarro" }, "company": "ULTRIMAX", "email": "larson.navarro@ultrimax.ca", "phone": "+1 (832) 452-3058", "address": "711 Wakeman Place, Shelby, Tennessee, 3886", "about": "Enim sunt nulla tempor occaecat id Lorem. Cupidatat do non ex quis exercitation. Veniam nisi qui est consequat et id culpa duis ipsum consectetur duis. Enim ex reprehenderit ipsum et laboris veniam. Sunt dolore do culpa Lorem cupidatat. Qui sit amet adipisicing tempor occaecat velit nulla eu magna culpa est fugiat. Anim magna occaecat veniam nostrud dolore duis minim amet.", "registered": "Sunday, May 6, 2018 1:06 PM", "latitude": "-18.778754", "longitude": "-14.150211", "tags": [ "occaecat", "tempor", "reprehenderit", "fugiat", "velit" ], "range": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ], "friends": [ { "id": 0, "name": "Lucy Mckay" }, { "id": 1, "name": "Lou Wolf" }, { "id": 2, "name": "Shaffer Pace" } ], "greeting": "Hello, Larson! You have 9 unread messages.", "favoriteFruit": "strawberry" }, { "_id": "5c0fea04b4246cf9b05dee4a", "index": 2, "guid": "0f5b0817-9dee-4470-978e-1e57d60d870f", "isActive": true, "balance": "$2,126.57", "picture": "http://placehold.it/32x32", "age": 30, "eyeColor": "brown", "name": { "first": "Dawson", "last": "Campbell" }, "company": "MYOPIUM", "email": "dawson.campbell@myopium.co.uk", "phone": "+1 (898) 552-3452", "address": "497 Irving Place, Magnolia, Vermont, 771", "about": "Eiusmod aliquip mollit ut anim minim amet veniam aute duis ex quis ad non sint. Non tempor eu officia aliqua cillum non voluptate eu exercitation qui fugiat irure consectetur sint. Eu quis proident do deserunt sunt fugiat et voluptate voluptate Lorem minim laboris excepteur nisi. Nisi incididunt laboris ullamco elit nulla enim occaecat minim. Fugiat cillum Lorem id incididunt tempor occaecat mollit excepteur. Eu aliquip aliquip qui duis officia laborum mollit.", "registered": "Saturday, November 21, 2015 12:01 PM", "latitude": "-83.798612", "longitude": "162.071891", "tags": [ "officia", "adipisicing", "aliquip", "esse", "Lorem" ], "range": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ], "friends": [ { "id": 0, "name": "Parker Clay" }, { "id": 1, "name": "Bowman Pacheco" }, { "id": 2, "name": "Lynne Madden" } ], "greeting": "Hello, Dawson! You have 9 unread messages.", "favoriteFruit": "strawberry" }, { "_id": "5c0fea04968b0f6c04459798", "index": 3, "guid": "83712f13-dab3-479e-b008-a686c713f656", "isActive": false, "balance": "$1,140.05", "picture": "http://placehold.it/32x32", "age": 26, "eyeColor": "blue", "name": { "first": "Moon", "last": "Mills" }, "company": "SCENTY", "email": "moon.mills@scenty.org", "phone": "+1 (855) 585-2051", "address": "976 Greene Avenue, Lafferty, Wisconsin, 8809", "about": "Lorem consectetur eiusmod labore nulla amet in Lorem nulla deserunt veniam. Do adipisicing eu proident pariatur exercitation adipisicing laborum occaecat eu elit. In incididunt dolore mollit aliqua officia. In esse anim non duis aliqua incididunt irure tempor dolore amet mollit. Amet voluptate sint eu ullamco sunt eiusmod do adipisicing culpa culpa non cupidatat enim velit.", "registered": "Tuesday, February 25, 2014 8:03 PM", "latitude": "16.571577", "longitude": "90.155055", "tags": [ "amet", "ex", "cillum", "labore", "mollit" ], "range": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ], "friends": [ { "id": 0, "name": "Josie Mccullough" }, { "id": 1, "name": "Myrna Hendricks" }, { "id": 2, "name": "Kayla Bruce" } ], "greeting": "Hello, Moon! You have 10 unread messages.", "favoriteFruit": "banana" }, { "_id": "5c0fea044ccce300cdd7fe43", "index": 4, "guid": "edfba3b0-39e2-45f8-97bc-8ad51f0f97d7", "isActive": false, "balance": "$1,580.81", "picture": "http://placehold.it/32x32", "age": 37, "eyeColor": "brown", "name": { "first": "Mills", "last": "Carrillo" }, "company": "SLAX", "email": "mills.carrillo@slax.net", "phone": "+1 (851) 413-3414", "address": "940 Hanson Place, Soham, California, 4566", "about": "Laborum do cillum laborum consequat laboris aliquip anim aliqua voluptate ut. Amet ipsum duis sint aliquip commodo commodo elit. Enim et et laborum duis laborum deserunt labore occaecat veniam officia incididunt ullamco ipsum tempor. Commodo excepteur aliquip id ullamco cillum et.", "registered": "Saturday, March 17, 2018 12:21 AM", "latitude": "39.195963", "longitude": "126.146007", "tags": [ "laboris", "reprehenderit", "cillum", "aute", "anim" ], "range": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ], "friends": [ { "id": 0, "name": "Emerson Justice" }, { "id": 1, "name": "Lambert Mason" }, { "id": 2, "name": "Rhodes Barron" } ], "greeting": "Hello, Mills! You have 8 unread messages.", "favoriteFruit": "strawberry" } ]; var test = function (array, id){ var startIndex = 0, stopIndex = array.length - 1, middle = Math.floor((stopIndex + startIndex)/2); while(array[middle]._id != id && startIndex < stopIndex){ if (id < array[middle]._id){ stopIndex = middle - 1; } else if (id > array[middle]._id){ startIndex = middle + 1; } middle = Math.floor((stopIndex + startIndex)/2); } return (array[middle]._id != id) ? undefined : array[middle]; }; var find = test(a,'5c0fea04b4246cf9b05dee4a');
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
lodash find
binary find
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!
Autogenerated LLM Summary
(model
llama3.2:3b
, generated one year ago):
It seems like you're ready to dive into the task at hand! You've provided two JSON strings, one with a test function and another with benchmark results. I'll assume you want me to: 1. Identify the purpose of the `test` function. 2. Extract information from the benchmark results. Please let me know what specific aspect of these inputs you'd like me to assist with, or if you have any questions about the provided data.
Related benchmarks:
Find item in array - Fork
Lodash find vs binary find
native find vs lodash _.find equal
String vs Object find
Compare prototype.find vs lodash/find
Comments
Confirm delete:
Do you really want to delete benchmark?