seung-lab / crackle

3D dense segmentation compression codec based on crack codes.
BSD 3-Clause "New" or "Revised" License
6 stars 0 forks source link

perf: optimize crack code creation #15

Closed william-silversmith closed 8 months ago

william-silversmith commented 8 months ago

Adds another 20%ish performance improvement for encoding.

I found the encoder does not need to compute the disjoint set or collect edges. Instead, we can scan through the adjacency graph looking for clusters, which is a memory aligned scan.

I also replaced 4 if statements in the symbol to codepoint encoder with a lookup table to reduce branch prediction errors.