Could there be a significant performance improvement by maintaining a second hash of just 'attr1' to pre-determine if any keys start with attr1?
No!
The time saved hashing a slightly shorter key for the first lookup will be completely negated by the need to do a second lookup if the first hits.
And using 3 keys will be significantly slower.
Moreover, multilevel hashes require considerably more memory (and memory management).
In reply to Re: Hash space/ time tradeoff
by BrowserUk
in thread Hash space/ time tradeoff
by Wiggins
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |