This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: expandable hash tables


In article <380741F2.F8587145@cygnus.com> you write:
>Thanks, Greg for your ideas.  I am certainly going to continue work on
>this stuff (as Jeff Law says
>iterate and iterate).  This requires many experiments because hash
>tables are good on practice but
>there is probability that they may work very bad in theory.  For me, big
>suprise was that I got the
>best result when the initial size of hash tables was minimal (I tested
>the package on some plumhall
>functions and on compilation of all egcs).  

I don't know if this is relevant to the case at hand, but I've had some
similar experience with hash tables recently.

Turns out the code I was using was producing a large number of empty
hash tables, so that the main benefit of hashes was only seen for the few
tables that were not empty.

In that specific case, I squeezed some efficiency out by lazily allocating 
the hash table, so that empty tables wouldn't need any work at all, 
whereas I would only incur a NULL pointer test in the lookup function.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]