Blender Git Commit Log

Git Commits -> Revision 2d3b460

February 20, 2015, 23:22 (GMT)
Rework ghash to make it fully dynamic, and lower load threshold.

So now, by default, when you remove an entry from a ghash and it gets below
'shrink' load limit, it resizes it buckets' array.

Also, lowered heavily 'grow' load limit, was 3, which is way too big and had important
impact on performances. Now using 3/4 (similar to java or python dict values), this seems
to give several tens of percents quicker insertions and lookups.

Regarding masking vs. modulo, so far all tests have shown that:
* There is no sensible difference in quality (i.e. both seem to yield more or less
the same quite even distribution);
* Masking is slightly quicker than modulo (as expected), but this is not much important globally.

Warnings:
* This code is far from ready for anything else than toying around, for now!
* Kept old 'modulo' code behind a #define for now, makes code slightly confusing though...

Commit Details:

Full Hash: 2d3b460ff259b19b412bc71c94580055061acb39
Parent Commit: 1181dda
Lines Changed: +181, -70

3 Modified Paths:

/source/blender/blenlib/BLI_ghash.h (+1, -0) (Diff)
/source/blender/blenlib/intern/BLI_ghash.c (+159, -65) (Diff)
/tests/gtests/blenlib/BLI_ghash_test.cc (+21, -5) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021