Skip to content

Commit

Permalink
perf: skip unifying equal labels
Browse files Browse the repository at this point in the history
On a small test on 512x512x512 connectomics data at 32x32x40
resolution, this brought down the time from 12 seconds to 7.
SciPy (which regarded the volume as binary) took around 5.9,
so we are moving from the 1980s or 1990s into the 2000s in
terms of performance. Using Wu or Grana would be even more
helpful.
  • Loading branch information
william-silversmith committed May 13, 2019
1 parent 2afce65 commit 472420c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cc3d.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ class DisjointSet {
}

void unify (T p, T q) {
if (p == q) {
return;
}

T i = root(p);
T j = root(q);

Expand Down

0 comments on commit 472420c

Please sign in to comment.