Guile Mailing List Archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: hash table subtleties







>I'd like to also repeat what I mentioned elsewhere - namely if you
>shrink the tables on deletions you can easily get the bad behavior of
>resizing every few operations (on a mix of insertions & deletions)
>causing the hash tables to give O(n) behavior instead of O(1).
>They'll be slower than an alist, let alone a balanced tree.

That doesn't mean you shouldn't shrink tables. It just means you should be
smart about it - have a high water mark and a low water mark. It's a bit
like the thermostat problem. You don't want the heater switching on and
off every two seconds when the temperature reaches equilibrium.




Guile Home | Main Index | Thread Index