[Mesa-dev] [PATCH 9/9] mesa: Convert the hash table for GL object ids to the open-addressing hash.

Chad Versace chad.versace at linux.intel.com
Wed Nov 7 17:32:55 PST 2012


On 11/06/2012 11:18 PM, Eric Anholt wrote:
> The previous 1023-entry chaining hash table never resized, so it was very
> inefficient when there were many objects live.  While one could have an even
> more efficient implementation than this (keep an array for genned names with
> packed IDs, or take advantage of the fact that key == hash or key ==
> *(uint32_t *)data to store less data), this is fairly fast, and I want a nice
> replacement hash table for other parts of Mesa, too.
> 
> It improves Minecraft performance 12.3% +/- 1.4% (n=9), dropping hash lookups
> from 8% of the profile to 0.5%.
> 
> I also tested cairo-gl, which should be a pessimal workload for this hash
> table: around 247000 FBOs created and destroyed, only around 65 live at any
> time, and few lookups of them between creation and destruction.  No
> statistically significant performance difference at n=76 (mean 20.3/20.4
> seconds, sd 2.8/3.2 seconds).  If I remove the >20 seconds outliers that
> appear to be due to thermal throttling, there's possibly a .97% +/- 0.31%
> performance win (n=61/59).  The choice of cutoff for outliers feels a lot like
> cooking the data, but I've gone through this process 3 times for minor
> iterations of the code with the same conclusion each time.
> 
> Reviewed-by: Brian Paul <brianp at vmware.com>
> ---
>  src/mesa/main/hash.c |  371 +++++++++++++++-----------------------------------
>  src/mesa/main/hash.h |    4 -
>  2 files changed, 113 insertions(+), 262 deletions(-)

Patches 7-8 are
Reviewed-by: Chad Versace <chad.versace at linux.intel.com>

Patches 9 is
Acked-by: Chad Versace <chad.versace at linux.intel.com>

Patch 6 breaks the Android build. I've uploaded a branch 'hashtable'
that contains your series without breaking the Android build. Please
take a look at it.

What I do in the series is insert after your patch 5 a small series that cleans
up some (but not all) of the insanity in src/mesa/Android.mk. Then I squash into
your patch 6 the the necessary changes to build the new program library on Android.
The remaining patches 7-9 are unchanged.


More information about the mesa-dev mailing list