Programming with Judy
The Judy Advantage
Hashing versus JudyL
Chapter 224
Most programmers understand that hashing with a static table can
deliver excellent performance. However when you use hashing, you must
remember to:
• Size your hash table correctly.
• Beware of operators like mod (i.e. %) on a PA-RISC system.
• Use any available optimizations, like mallopt(3C).
• In-line your code.
When you use Judy, you don’t need to remember anything on this
checklist! Judy takes care of all the optimizations for you.
In summary
Judy is a hybrid digital tree that chooses data structures for each
node appropriate to the population below the node, thereby allowing
tree-level compression and balanced memory usage.
Over large populations, the Judy advantage becomes clear when
Judy is benchmarked against other search and retrieval methods,
such as hashing.