From 1d1ccf7f9da951ed02852bc5d354d0ee831f3a71 Mon Sep 17 00:00:00 2001 From: Gilvir Gill Date: Wed, 13 Mar 2024 00:58:34 -0400 Subject: [PATCH] removed final hash calls for eager bucket check --- src/sketch.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/sketch.cpp b/src/sketch.cpp index feca9649..d69f09b5 100644 --- a/src/sketch.cpp +++ b/src/sketch.cpp @@ -282,12 +282,6 @@ SketchSample Sketch::sample() { size_t idx = sample_idx++; size_t first_column = idx * cols_per_sample; - if (Bucket_Boruvka::is_empty(buckets[num_buckets - 1])) - return {0, ZERO}; // the "first" bucket is deterministic so if all zero then no edges to return - - if (Bucket_Boruvka::is_good(buckets[num_buckets - 1], checksum_seed())) - return {buckets[num_buckets - 1].alpha, GOOD}; - #ifdef EAGER_BUCKET_CHECK for (size_t col = first_column; col < first_column + cols_per_sample; ++col) { vec_t col_good_buckets = good_buckets[col]; @@ -306,6 +300,13 @@ SketchSample Sketch::sample() { return {0, FAIL}; #endif + if (Bucket_Boruvka::is_empty(buckets[num_buckets - 1])) + return {0, ZERO}; // the "first" bucket is deterministic so if all zero then no edges to return + + if (Bucket_Boruvka::is_good(buckets[num_buckets - 1], checksum_seed())) + return {buckets[num_buckets - 1].alpha, GOOD}; + + for (size_t col = first_column; col < first_column + cols_per_sample; ++col) { int row = bkt_per_col - 1; while (Bucket_Boruvka::is_empty(buckets[col * bkt_per_col + row]) && row > 0) {