in reply to Perl's hash table implementation
The “performance” of a hash-table will always depend very heavily upon the exact distribution of key-values presented. If the hash function is favorable to the actual key-data, distributing those values equitably among the buckets, performance of almost any table will be “good;” otherwise not.
A lot depends also upon what you are measuring. Are you, say, looking for the time it takes to locate a particular key that (is|is not) there? The time required to do an insert or delete? The time required (and the algorithm) to resolve collisions?
Memory can also be a factor. Hash tables often have a big footprint. Page faults can be a problem, rendering the hash-table worst case pretty close to “a disk file.” But... algorithms meant to assure good performance in the face of frequent paging-activity might be deemed to be “contributing to unnecessary overhead” if the tests were performed on a memory-plentiful system.
The way that you frame your question has a great deal to do with what is the “right” answer.
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl's hash table implementation
by jc (Acolyte) on Oct 07, 2010 at 20:04 UTC |