seung-lab / zmesh

Marching Cubes & Mesh Simplification on multi-label 3D images.
GNU General Public License v3.0
58 stars 8 forks source link

perf: use robin_hood flat hash map to improve simplification #33

Closed william-silversmith closed 2 years ago

william-silversmith commented 2 years ago

Test with slow example on M1:

New code: 16:40 (1000s) to process Old code: 23:36 (1416s)

1.42x speedup

Test of connectomics.npy:

New code: 488.26s user (8:43 total, 523s) Old Code: 678.19s user 16.93s system (11:44.37 total, 704s)

1.34x speedup.

william-silversmith commented 2 years ago

With robin_hood also on the faces hash for connectomics.npy: 413.25s user 15.75s system 97% cpu 7:18.58 total (439s)

This is a 1.19x speedup over the previous code and 1.60x overall.

For the very slow volume: 17:44, this is worse than before, but still much better than the original data structure.

william-silversmith commented 2 years ago

With the heap modified:

connectomics.npy: 268s (1.5x relative, 2.5x total) slow volume: 539s (2.0x, relative, 2.6x total)