Skip to content

Commit

Permalink
Fix missing initialization of g_num_copies and g_num_hashes / Update …
Browse files Browse the repository at this point in the history
…test for large objects with a more reasonable hash function. @greg7mdp
  • Loading branch information
PhilipDeegan committed Sep 30, 2016
1 parent 0586f10 commit 4ee59b2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/bench.cc
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,11 @@ class Rusage {
steady_clock::time_point start_;
};

inline void Rusage::Reset() { start_ = steady_clock::now(); }
inline void Rusage::Reset() {
g_num_copies = 0;
g_num_hashes = 0;
start_ = steady_clock::now();
}

inline double Rusage::UserTime() {
auto diff = steady_clock::now() - start_;
Expand Down Expand Up @@ -655,7 +659,7 @@ int main(int argc, char** argv) {
if (FLAGS_test_8_bytes) test_all_maps<HashObject<8, 8>>(8, iters / 2);
if (FLAGS_test_16_bytes) test_all_maps<HashObject<16, 16>>(16, iters / 4);
if (FLAGS_test_256_bytes)
test_all_maps<HashObject<256, 256>>(256, iters / 32);
test_all_maps<HashObject<256, 32>>(256, iters / 32);

return 0;
}

0 comments on commit 4ee59b2

Please sign in to comment.