From a0e93370648275fe585388700b8963ed20a5572a Mon Sep 17 00:00:00 2001 From: Stefan Hermann Date: Mon, 11 Nov 2024 11:20:02 +0100 Subject: [PATCH] perf and bugfix --- include/utils/bucketers.hpp | 8 ++++---- include/utils/dense_encoders.hpp | 2 +- src/build.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/utils/bucketers.hpp b/include/utils/bucketers.hpp index 103e083..45ea9da 100644 --- a/include/utils/bucketers.hpp +++ b/include/utils/bucketers.hpp @@ -12,14 +12,14 @@ struct table_bucketer { const double alpha) { base.init(num_buckets, lambda, table_size, alpha); - fulcrums.push_back(0); + fulcrums[0] = 0; for (size_t xi = 0; xi < FULCS - 1; xi++) { double x = double(xi) / double(FULCS - 1); double y = base.bucketRelative(x); auto fulcV = uint64_t(y * double(num_buckets << 16)); - fulcrums.push_back(fulcV); + fulcrums[xi + 1] = fulcV; } - fulcrums.push_back(num_buckets << 16); + fulcrums[FULCS - 1] = num_buckets << 16; } inline uint64_t bucket(const uint64_t hash) const { @@ -58,7 +58,7 @@ struct table_bucketer { Bucketer base; static const uint64_t FULCS = 2048; - std::vector fulcrums; + std::array fulcrums; }; struct opt_bucketer { diff --git a/include/utils/dense_encoders.hpp b/include/utils/dense_encoders.hpp index ecb6a6d..99d43e9 100644 --- a/include/utils/dense_encoders.hpp +++ b/include/utils/dense_encoders.hpp @@ -29,7 +29,7 @@ struct diff { } size_t num_bits() const { - return sizeof(m_increment) + m_encoder.num_bits(); + return 8 * sizeof(m_increment) + m_encoder.num_bits(); } inline uint64_t access(uint64_t i) const { diff --git a/src/build.cpp b/src/build.cpp index 9a6f39b..143b8df 100644 --- a/src/build.cpp +++ b/src/build.cpp @@ -523,7 +523,7 @@ void build(cmd_line_parser::parser const& parser, Iterator keys, uint64_t num_ke return; } - config.secondary_sort = false; // parser.get("secondary_sort"); + config.secondary_sort = true; // parser.get("secondary_sort"); config.minimal = parser.get("minimal"); config.verbose = parser.get("verbose");