Hacker News new | ask | show | jobs
by AstralStorm 2349 days ago
Patricia tries are less local than typical Radix tree implementations.

In typical usage of thousands of items, locality wins, low constant factors win. Simple lazily defragmented list can be faster than constant size hash table thanks to constant factors, faster than sorting.

Unique objects have a perfect hashing function, but it still has to be fast. Sometimes making it an intrusive structure is a major speedup due to cache locality - let the unique object track where it is.

If you cannot know the maximum size (which you will with unique objects), then get more adaptive.