BLI: New Edgehash and EdgeSet implementation
authorJacques Lucke <mail@jlucke.com>
Thu, 13 Dec 2018 10:21:31 +0000 (11:21 +0100)
committerJacques Lucke <mail@jlucke.com>
Thu, 13 Dec 2018 10:21:31 +0000 (11:21 +0100)
commitaa63a87d37d3b190ec8c957c892af9c1be2ea301
tree254ad88790a7f36ca930ba3665bcd2d06092a399
parentcef2a25518dd41beb5335e73e5b765926b1eb387
BLI: New Edgehash and EdgeSet implementation

The new data structure uses open addressing instead of chaining to resolve collisions in the hash table.

This new structure was never slower than the old implementation in my tests. Code that first inserts all edges and then iterates through all edges (e.g. to remove duplicates) benefits the most, because the `EdgeHashIterator` becomes a simple for loop over a continuous array.

Reviewer: campbellbarton

Differential Revision: D4050
source/blender/blenlib/BLI_edgehash.h
source/blender/blenlib/intern/edgehash.c
tests/gtests/blenlib/BLI_edgehash_test.cc [new file with mode: 0644]
tests/gtests/blenlib/CMakeLists.txt