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 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36
Browser:
Chrome 136
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Hashmap
785.6 Ops/sec
Dictionary object
679.7 Ops/sec
_uniqWith
1.2 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());