Skip to content

Commit

Permalink
tightened allocations
Browse files Browse the repository at this point in the history
  • Loading branch information
Gillgamesh committed Nov 7, 2024
1 parent 5eea1aa commit 658fe63
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion include/sketch.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ class Sketch {
static vec_t calc_vector_length(node_id_t num_vertices) {
// return ceil(double(num_vertices) * (num_vertices - 1) / 2);
// return num_vertices * 4;
return 50; // round to something thats approx 2^6
// return 50; // round to something thats approx 2^6
return 15;
// return 1 + num_vertices / 16 ;
}

Expand Down
6 changes: 3 additions & 3 deletions src/sketch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ void Sketch::update(const vec_t update_idx) {
// TODO - magical number
// std::cout << "Buffer full, reallocating" << std::endl;
// reallocate((bkt_per_col * 8) / 5);
reallocate(bkt_per_col + 3);
reallocate(bkt_per_col + 1);
// std::cout << "and now injecting" << std::endl;
inject_buffer_buckets();
// bucket_buffer.insert(i, depth, {update_idx, checksum});
Expand Down Expand Up @@ -394,7 +394,7 @@ void Sketch::merge(const Sketch &other) {
while (!sufficient_space) {
// std::cout << "Merge: Buffer full, reallocating" << std::endl;
// reallocate((bkt_per_col * 8) / 5);
reallocate(bkt_per_col + 3);
reallocate(bkt_per_col + 1);
inject_buffer_buckets();
sufficient_space = !bucket_buffer.over_capacity();
}
Expand Down Expand Up @@ -487,7 +487,7 @@ void Sketch::range_merge(const Sketch &other, size_t start_sample, size_t n_samp
while (!sufficient_space) {
// std::cout << "Merge: Buffer full, reallocating" << std::endl;
// reallocate((bkt_per_col * 8) / 5);
reallocate(bkt_per_col + 3);
reallocate(bkt_per_col + 1);
inject_buffer_buckets();
sufficient_space = !bucket_buffer.over_capacity();
}
Expand Down

0 comments on commit 658fe63

Please sign in to comment.