Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Hashmap vs Dictionary object vs lodash uniqWith
Comparing performance of: Hashmap, Dictionary and lodash uniqWith.
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0
Browser:
Firefox 131
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Hashmap
421.0 Ops/sec
Dictionary object
495.5 Ops/sec
_uniqWith
0.7 Ops/sec
HTML Preparation code:
<script src='https://cdn.jsdelivr.net/npm/lodash@4.17.10/lodash.min.js'></script>
Script Preparation code:
var valueList2 = ["apa", "anya", "gyerek"]; for (var i = 0; i < 14200; i++) { valueList2.push("Apa" + i); }
Tests:
Hashmap
var res2 = new Map(); for (var value of valueList2) { if (!res2.get(value.toLowerCase())) { res2.set(value.toLocaleLowerCase(), value.toLocaleLowerCase()); } }
Dictionary object
var dictionary = {}; for (var i = 0; i < valueList2.length; i++) { var item = valueList2[i].toLowerCase(); if (!dictionary[item]) { dictionary[item] = i; } }
_uniqWith
_.uniqWith(valueList2, (arrVal, othVal) => arrVal.toLowerCase() === othVal.toLowerCase());