Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2000:
[Freeciv-Dev] patch: hashtable stuff, attempt #2
Home

[Freeciv-Dev] patch: hashtable stuff, attempt #2

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] patch: hashtable stuff, attempt #2
From: Jed Davis <jldavis@xxxxxxxxxxxxxx>
Date: Sun, 30 Jul 2000 23:00:51 -0400

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

Attachment: hash.diff
Description: Text document


[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] patch: hashtable stuff, attempt #2, Jed Davis <=