3 ms·
I've done a bit of work with tries and hash functions and found that in-memory tries are almost universally faster than in-memory hashes, no matter how good the
by doty 17y ago
I've done a bit of work with tries and hash functions and found that in-memory tries are almost universally faster than in-memory hashes, no matter how good the hash function is.
Do you have any insight on why this would be? It's not very intuitive to me.
A hash-table with low load has relatively small hash buckets and so touches fairly little memory, and string keys are fairly local, so I would have expected memory costs to dominate. Insertion and deletion from a hash table should require fewer allocations than insertion and deletion from a trie.
- elblanco 17y agosee http://news.ycombinator.com/item?id=1240914 http://news.ycombinator.com/item?id=1240914