[Freeciv-Dev] patch: hashtable stuff, attempt #2
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Again, I hope they're improvements:
* Table sizes are now primes instead of powers of 2, and hash_fval_int and
hash_fval_string have been simplified. This seemed the simplest way to
address a flaw in the old hash_fval_int.
& I should note that the list of prime table sizes, string hash function (a
simple radix-5 polynomial encoding), integer hash function (identity), and
most of a binary search algorithm were more or less taken from the g++ STL
(courtesy of SGI and HP); I didn't think these inclusions were significant
enough to require a copyright notice.
* Tables now resize when the fraction of used buckets goes below a certain
point. Also tables expand a little more conservatively and are more likely
than before to rehash with the same size or shrink. There probably isn't
any noticeable effect, either positive or negative, on CPU or memory usage.
--Jed
hash.diff
Description: Text document
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] patch: hashtable stuff, attempt #2,
Jed Davis <=
|
|