Skip to content

Commit 07df6bb

Browse files
committed
Remove test for Jumphash in Memento
1 parent 015b2f0 commit 07df6bb

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

memento/mementoengine.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,6 @@ class MementoEngine final {
3838
*/
3939
uint32_t getBucket(std::string_view key) const noexcept {
4040
const auto hash{XXH64(key.data(), key.size(), 0)};
41-
42-
/* If there are no removed nodes, just perform Jump */
43-
if (m_lastRemoved == m_bArraySize) {
44-
return JumpConsistentHash(hash, m_bArraySize);
45-
}
46-
4741
/*
4842
* We invoke JumpHash to get a bucket
4943
* in the range [0,bArraySize-1].
@@ -96,12 +90,6 @@ class MementoEngine final {
9690
*/
9791
uint32_t getBucketCRC32c(uint64_t key, uint64_t seed) const noexcept {
9892
const auto hash = crc32c_sse42_u64(key, seed);
99-
100-
/* If there are no removed nodes, just perform Jump */
101-
if (m_lastRemoved == m_bArraySize) {
102-
return JumpConsistentHash(hash, m_bArraySize);
103-
}
104-
10593
/*
10694
* We invoke JumpHash to get a bucket
10795
* in the range [0,bArraySize-1].

speed_test.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,13 @@ int bench(const std::string_view name, const std::string &filename,
152152
print_memory_stats("AfterRemovals");
153153
#endif
154154

155-
int64_t sum{0};
155+
volatile int64_t bucket{0};
156156
auto start{clock()};
157157
for (uint32_t i = 0; i < num_keys; ++i) {
158158
#ifdef USE_PCG32
159-
sum += engine.getBucketCRC32c(rng(), rng());
159+
bucket = engine.getBucketCRC32c(rng(), rng());
160160
#else
161-
sum += engine.getBucketCRC32c(rand(), rand());
161+
bucket = engine.getBucketCRC32c(rand(), rand());
162162
#endif
163163
}
164164
auto end{clock()};
@@ -170,7 +170,7 @@ int bench(const std::string_view name, const std::string &filename,
170170
auto elapsed{static_cast<double>(end - start) / CLOCKS_PER_SEC};
171171
#ifdef USE_HEAPSTATS
172172
auto maxheap{maximum};
173-
fmt::println("{} Elapsed time is {} seconds, maximum heap allocated memory is {} bytes, sizeof({}) is {}, sum is {}", name, elapsed, maxheap, name, sizeof(Algorithm), sum);
173+
fmt::println("{} Elapsed time is {} seconds, maximum heap allocated memory is {} bytes, sizeof({}) is {}", name, elapsed, maxheap, name, sizeof(Algorithm));
174174
results_file << name << ":\tAnchor\t" << anchor_set << "\tWorking\t"
175175
<< working_set << "\tRemovals\t" << num_removals << "\tRate\t"
176176
<< norm_keys_rate / elapsed << "\tMaxHeap\t" << maxheap << "\tAlgoSizeof\t" << sizeof(Algorithm)<< "\n";

0 commit comments

Comments
 (0)