Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2015-03-19 19:36:59 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-03-19 19:37:54 +0300
commitcfdd27381c6730dc0d8d4bb51c132b29337b8af5 (patch)
tree27d5b8c646fc31dc9fd623f3e2995b1c3f391305 /source/blender/blenlib/BLI_hash_mm2a.h
parent881e05fc54058bc04b217817808315b2f9691c2a (diff)
GHash - code reorganization, performance enhancements, add a few missing utils to API.
This patch is the root of the GHash rework, all other diff will be based on it: Reduce average load from 3.0 to 0.75 ---------------------------------- This is the big performance booster part, e.g. makes tracing a dyntopo stroke between 25% and 30% faster. Not much to say about it, aside that it obviously increase memory footprint (about 25% - 30% too). Add optional shrinking ---------------------------------- I.e. ghashes/gsets can now shrink their buckets array when you remove enough entries. This remains optional and OFF by default. Add code to use masking instead of modulo ---------------------------------- Buckets indices are obtained from hashes by “reducing” the hash value into the valid bucket range. This can be done either by bit-masking, or using modulo operation. The former is quicker, but requires real hashes, while the later is slower (average 10% impact on ghash operations) but can also be used as a 'fake' hashing on raw values, like e.g. indices. In Blender currently not all ghash usages actually hash their keys, so we stick to modulo for now (masking is ifdef’ed out), we may however investigate the benefits of switching to masking with systematic very basic hashing later… Add various missing API helpers ---------------------------------- I.e. a way to deep-copy a ghash/gset, and a way to (re-)reserve entries (i.e. manually grow or shrink the ghash after its creation). Various code refactoring ---------------------------------- * Get rid of the 'hack' regarding ghash size when used as gset (it’s simpler and safer to have two structs defined here, and cast pointers as needed). * Various re-shuffle and factorization in low-level internal code. * Some work on hashing helpers, introducing some murmur2a-based hashing too. Thanks a bunch to Campbell for the extensive review work. :) Reviewers: sergey, campbellbarton Subscribers: psy-fi, lukastoenne Projects: #bf_blender Maniphest Tasks: T43766 Differential Revision: https://developer.blender.org/D1178
Diffstat (limited to 'source/blender/blenlib/BLI_hash_mm2a.h')
-rw-r--r--source/blender/blenlib/BLI_hash_mm2a.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_hash_mm2a.h b/source/blender/blenlib/BLI_hash_mm2a.h
index 007dec4f4d6..6beaf50ae8f 100644
--- a/source/blender/blenlib/BLI_hash_mm2a.h
+++ b/source/blender/blenlib/BLI_hash_mm2a.h
@@ -42,4 +42,6 @@ void BLI_hash_mm2a_add_int(BLI_HashMurmur2A *mm2, int data);
uint32_t BLI_hash_mm2a_end(BLI_HashMurmur2A *mm2);
+uint32_t BLI_hash_mm2(const unsigned char *data, size_t len, uint32_t seed);
+
#endif /* __BLI_HASH_MM2A_H__ */