Wouldn’t the performance of HashMap Lookup be O(1)*, not O(log n)? It states the key value must implement hash and eq, ideally this means you eventually end up with a hash table, which would mean faster lookups.
It’s implemented underneath with an HAMT (hash array mapped trie) iirc. So although it compares on hashes it’s an ordered map over those hashes w/ O(log n) for most ops.
Wouldn’t the performance of HashMap Lookup be
O(1)*, notO(log n)? It states the key value must implement hash and eq, ideally this means you eventually end up with a hash table, which would mean faster lookups.It’s implemented underneath with an HAMT (hash array mapped trie) iirc. So although it compares on hashes it’s an ordered map over those hashes w/ O(log n) for most ops.