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
AgeCommit message (Collapse)Author
2015-05-11GHash: use const keys when only used for lookupsCampbell Barton
2015-05-11GHash: Add BLI_ghash_ensure_p_ex to copy the keyCampbell Barton
Needed in cases where the memory from each key is owned by the GHash.
2015-04-13GHash: use unsigned int for ghash_sizeCampbell Barton
2015-04-11BMesh: simplify hashing for dyntopoCampbell Barton
Was using pointer hashing when the keys are in fact uint's. Since they're well distributed from the rangetree, no need to do bit-shifting tricks. just use int as hash. Gives ~8% speedup in own tests.
2015-04-06GHash: ensure function, avoids multiple lookupsCampbell Barton
2015-04-06GHash: no reason to use GSetEntry in ghash APICampbell Barton
2015-03-23Cleanup: comments, styleCampbell Barton
2015-03-22Fix wrong sizeof() in new ghash hashing helpers code.Bastien Montagne
Spotted by Coverity.
2015-03-21Cleanup: use tabsCampbell Barton
2015-03-19GHash - code reorganization, performance enhancements, add a few missing ↵Bastien Montagne
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
2015-01-26Cleanup: strcmp/strncmp -> STREQ/STREQLEN (in boolean usage).Bastien Montagne
Makes usage of those funcs much more clear, we even had mixed '!strcmp(foo, bar)' and 'strcmp(foo, bar) == 0' in several places...
2014-12-17Docs: comments (hash table & beauty fill)Campbell Barton
2014-09-25Fix previous commit rB34abb614f1344a6, which broke addons translations.Bastien Montagne
Ghash comp callbacks must return false in case a & b are equal! Also slightly cleaned up gash code using those comp func, since those return booleans now, let's compare tham against booleans!
2014-09-25GHash: use bool for comparison (simplify compare)Campbell Barton
2014-08-12GHash: add flag get/set for gsetCampbell Barton
2014-08-11CommentsCampbell Barton
2014-08-07GHash/EdgeHash: avoid NULL check on iterator initCampbell Barton
2014-07-30GHash: generic comparison for int[4]Campbell Barton
2014-07-14GHash, EdgeHash: add debugging function to measure the hash qualityCampbell Barton
Can use to check on improvements to hash functions.
2014-06-13GSet, GHash: Add BLI_gset_add, since its common to add members to a setCampbell Barton
also rename BLI_edgeset_reinsert -> BLI_edgeset_add, in this case its the same.
2014-05-14Code cleanup: doxy commentsCampbell Barton
2014-04-21GHash, Edgehash: add lookup_default() funcs.Campbell Barton
Returns a fallback argument when the key isn't found.
2014-04-20GHash, EdgeHash: hint on unlikely branchCampbell Barton
also avoid searching buckets for empty hashes
2014-04-15GHash: add BLI_ghashutil_uinthash_v4 for hashing 4 ints at onceCampbell Barton
2014-04-15GHash: add typed hash functions (were all (void *))Campbell Barton
- BLI_ghashutil_strhash_n takes string length, to avoid terminating the string before hashing. - BLI_ghashutil_inthash/uinthash take ints, to avoid casting to (void *) This also showed up incorrect use of inthash, which was using a pointer.
2014-04-08GHash/Edgehash: make simple iterator checking functions inline.Campbell Barton
also remove NULL check, only a few areas made use of this.
2014-04-05Mempool: remove BLI_MEMPOOL_SYSMALLOC, MEM_* allocs are more efficient nowCampbell Barton
2013-11-01code cleanup: spellingCampbell Barton
2013-09-02warning cleanup: correct some odd returns and quiet strict flag warnings on ↵Campbell Barton
some systems.
2013-09-02add hash iterator functions to access the pointer to the value.Campbell Barton
2013-09-01move strict compiler checks into a header so its easier to manage in one ↵Campbell Barton
place (pragmas were copied around). also enable more strict warnings for BLF (which had some incorrect casts).
2013-08-31mempool internal change, use unsigned ints where possible (less overhead),Campbell Barton
also quiet compiler warning for BLI_LINKSTACK_FREE macro.
2013-08-27ghash/bli-listbase edits, rename BLI_ghash_pop -> BLI_ghash_popkey (since it ↵Campbell Barton
takes a key as an arg and isnt popping any element from the hash as you might expect). add BLI_pophead/tail, since getting the first element from a list and removing it is a common task.
2013-08-26internal changes to ghash/edgehash, reorganize to split out resizing the ↵Campbell Barton
hash from insertion.
2013-08-26add some safety checks in debug mode to ensure sets/hashes aren't confused.Campbell Barton
2013-08-26minor changes to edgehassh/ghashCampbell Barton
- no need to zero vars when freeing ghash - de duplicate ghash remove code. - edgehash clear now works more like ghash.
2013-08-26BKI_gset and EdgeSet api, use when hash values aren't used (reuses ghash ↵Campbell Barton
internally without allocating space for the value).
2013-08-25move doxy docs out of the ghash header into the C file.Campbell Barton
2013-08-25clearing the mempool can now keep more then a single element reserved.Campbell Barton
2013-08-25fix leak in BLI_ghash_clear(). was never freeing entries, add ↵Campbell Barton
BLI_mempool_clear utility function.
2013-08-25doxygen docs for ghash/edgehashCampbell Barton
2013-08-25For pointer hashing use the same method as python, it gives better distribution.Campbell Barton
some tests with high poly mesh data in hashes. - empty buckets before 4-5%, after 1-2% - speedup for hash lookups, in my tests lookups take approx ~60% of the time they did before.
2013-08-25use ints for ghash/edgehash flags, since its allocated theres not much point ↵Campbell Barton
to try save a few bytes here.
2013-08-24add versions of BLI_ghash_int_new, BLI_ghash_str_new, etc. that take a ↵Campbell Barton
reserve argument.
2013-08-24revert bucket size change (edgehash was this way for years, since r26206, ↵Campbell Barton
ghash since r57657) having 2 free buckets for each entry is faster but uses more memory. use the original size, best case 3 entries per bucket.
2013-08-24ghash and edgehash api, allow newly defined hashes to take in the size of ↵Campbell Barton
the hash as an arg (avoids resizing in simple cases when the hash is created and filled immediately).
2013-08-22ghash/edgehash flag wasn't being initialized for new hashes. also init vars ↵Campbell Barton
in same order for ghash/edgehash.
2013-08-21rename recently added BLI_ghash_assign() -> BLI_ghash_reinsert()Campbell Barton
2013-08-18Fix a few compiler warnings reported by clang.Brecht Van Lommel
2013-08-18add hash function BLI_ghash_assign, BLI_edgehash_assignCampbell Barton
avoids remove,insert and only hashes the key once.