diff options
author | Peter Dillinger <peterd@fb.com> | 2019-10-24 17:14:27 -0700 |
---|---|---|
committer | Facebook Github Bot <facebook-github-bot@users.noreply.github.com> | 2019-10-24 17:16:46 -0700 |
commit | ca7ccbe2ea6be042f90f31eb75ad4dca032dbed1 (patch) | |
tree | 3501f917416ba4d23628fc364c9b5315dbb7ae33 /trace_replay | |
parent | ec11eff3bc15b8df3c038021ca0a0180da5eac9b (diff) |
Misc hashing updates / upgrades (#5909)
Summary:
- Updated our included xxhash implementation to version 0.7.2 (== the latest dev version as of 2019-10-09).
- Using XXH_NAMESPACE (like other fb projects) to avoid potential name collisions.
- Added fastrange64, and unit tests for it and fastrange32. These are faster alternatives to hash % range.
- Use preview version of XXH3 instead of MurmurHash64A for NPHash64
-- Had to update cache_test to increase probability of passing for any given hash function.
- Use fastrange64 instead of % with uses of NPHash64
-- Had to fix WritePreparedTransactionTest.CommitOfDelayedPrepared to avoid deadlock apparently caused by new hash collision.
- Set default seed for NPHash64 because specifying a seed rarely makes sense for it.
- Removed unnecessary include xxhash.h in a popular .h file
- Rename preview version of XXH3 to XXH3p for clarity and to ease backward compatibility in case final version of XXH3 is integrated.
Relying on existing unit tests for NPHash64-related changes. Each new implementation of fastrange64 passed unit tests when manipulating my local build to select it. I haven't done any integration performance tests, but I consider the improved performance of the pieces being swapped in to be well established.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/5909
Differential Revision: D18125196
Pulled By: pdillinger
fbshipit-source-id: f6bf83d49d20cbb2549926adf454fd035f0ecc0d
Diffstat (limited to 'trace_replay')
-rw-r--r-- | trace_replay/block_cache_tracer.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/trace_replay/block_cache_tracer.cc b/trace_replay/block_cache_tracer.cc index c70290b67..0cf394afa 100644 --- a/trace_replay/block_cache_tracer.cc +++ b/trace_replay/block_cache_tracer.cc @@ -28,8 +28,8 @@ bool ShouldTrace(const Slice& block_key, const TraceOptions& trace_options) { } // We use spatial downsampling so that we have a complete access history for a // block. - const uint64_t hash = GetSliceNPHash64(block_key); - return hash % trace_options.sampling_frequency == 0; + return 0 == fastrange64(GetSliceNPHash64(block_key), + trace_options.sampling_frequency); } } // namespace |