Skip to content

Commit

Permalink
Merge pull request #74 from stefanfred/dev
Browse files Browse the repository at this point in the history
perf and bugfix
  • Loading branch information
jermp authored Nov 11, 2024
2 parents 037fd99 + a0e9337 commit bdb0cce
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions include/utils/bucketers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -58,7 +58,7 @@ struct table_bucketer {

Bucketer base;
static const uint64_t FULCS = 2048;
std::vector<uint64_t> fulcrums;
std::array<uint64_t, FULCS> fulcrums;
};

struct opt_bucketer {
Expand Down
2 changes: 1 addition & 1 deletion include/utils/dense_encoders.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/build.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool>("secondary_sort");
config.secondary_sort = true; // parser.get<bool>("secondary_sort");
config.minimal = parser.get<bool>("minimal");
config.verbose = parser.get<bool>("verbose");

Expand Down

0 comments on commit bdb0cce

Please sign in to comment.