On Tue, Apr 10, 2012 at 06:35:58PM -0700, Lawrence Crowl wrote: > The standard says they need not ignore them. > > I was thinking more about iterating over the contents. What in the > current code is an indirect function call inside of a loop becomes > mostly be inline functions in a C++ iterator style. The loop is now > fully graspable by the optimizer.
That comes with its cost though, as we have hundreds of hashtables for various kinds of types, you'd get hundreds of different instantiations of the hash table code. hashtab.c is significantly more I-cache friendly than that. If a hash table doesn't need to be rehashed and the *with_hash routines are used, only the eq_f callback is called a few times (on each collision). Jakub