Age | Commit message (Collapse) | Author |
|
|
|
Needed in cases where the memory from each key is owned by the GHash.
|
|
|
|
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.
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Can use to check on improvements to hash functions.
|
|
- ensure GET_INT_FROM_POINTER us only used to get values
- rename STACK_POP_ELSE -> STACK_POP_DEFAULT
|
|
also rename BLI_edgeset_reinsert -> BLI_edgeset_add, in this case its the same.
|
|
Returns a fallback argument when the key isn't found.
|
|
|
|
- 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.
|
|
also remove NULL check, only a few areas made use of this.
|
|
|
|
|
|
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.
|
|
internally without allocating space for the value).
|
|
|
|
|
|
to try save a few bytes here.
|
|
reserve argument.
|
|
the hash as an arg (avoids resizing in simple cases when the hash is created and filled immediately).
|
|
In previous optimization in outliner I assumed that order in treehash was not important.
But testing outliner in datablocks mode revealed a problem: when user expands multiple recursive levels and then closes any element, it always closed the top level of recursion.
Now it should work fine with recursive trees.
Now treehash contains groups of elements indexed by (id,nr,type). Adding an element with the same (id,nr,type) results in appending it to existing group. No duplicates are possible in treehash.
This commit should also make lookups a little bit faster, because searching in small arrays by "used" is faster than searching in hashtable with duplicates by "id,nr,type,used".
|
|
|
|
avoids remove,insert and only hashes the key once.
|
|
- use single inlined lookup function.
- move comments into source.
- pack iterator vars more efficiently.
|
|
ghash/edgehash.
the outliner does this intentionally, so add a flag to allow this situation optionally.
|
|
|
|
|
|
also added the underlying subdivision as a standalone operator in the edge menu, named: subdivide edge-ring.
http://www.graphicall.org/ftp/ideasman42/bridge_subd.png
|
|
was renamed fairly recently but other similar iterators not negated
like this, would prefer to keep it as it was
|
|
|
|
PyNodes opens up the node system in Blender to scripters and adds a number of UI-level improvements.
=== Dynamic node type registration ===
Node types can now be added at runtime, using the RNA registration mechanism from python. This enables addons such as render engines to create a complete user interface with nodes.
Examples of how such nodes can be defined can be found in my personal wiki docs atm [1] and as a script template in release/scripts/templates_py/custom_nodes.py [2].
=== Node group improvements ===
Each node editor now has a tree history of edited node groups, which allows opening and editing nested node groups. The node editor also supports pinning now, so that different spaces can be used to edit different node groups simultaneously. For more ramblings and rationale see (really old) blog post on code.blender.org [3].
The interface of node groups has been overhauled. Sockets of a node group are no longer displayed in columns on either side, but instead special input/output nodes are used to mirror group sockets inside a node tree. This solves the problem of long node lines in groups and allows more adaptable node layout. Internal sockets can be exposed from a group by either connecting to the extension sockets in input/output nodes (shown as empty circle) or by adding sockets from the node property bar in the "Interface" panel. Further details such as the socket name can also be changed there.
[1] http://wiki.blender.org/index.php/User:Phonybone/Python_Nodes
[2] http://projects.blender.org/scm/viewvc.php/trunk/blender/release/scripts/templates_py/custom_nodes.py?view=markup&root=bf-blender
[3] http://code.blender.org/index.php/2012/01/improving-node-group-interface-editing/
|
|
|
|
always used in that context so we can at least avoid reverting it twice
:p.
|
|
path_util_1.patch from Lawrence D'Oliveiro (ldo)
|
|
avoid per vert/edge/face string lookups in BMO_slot_map_* functions --- used in array modifier, subdivide, remove doubles and other tools.
|
|
same time, saves a lookup if you need to check if the item exists before removing.
|
|
Added four new functions as shortcuts to creating GHashes that use the
standard ptr/str/int/pair hash and compare functions.
GHash *BLI_ghash_ptr_new(const char *info);
GHash *BLI_ghash_str_new(const char *info);
GHash *BLI_ghash_int_new(const char *info);
GHash *BLI_ghash_pair_new(const char *info);
Replaced almost all occurrences of BLI_ghash_new() with one of the
above functions.
|
|
|
|
|
|
|
|
|
|
- spelling - turns out we had tessellation spelt wrong all over.
- use \directive for doxy (not @directive)
- remove BLI_sparsemap.h - was from bmesh merge IIRC but entire file commented and not used.
|