mirror of
https://github.com/facebook/rocksdb.git
synced 2024-11-25 22:44:05 +00:00
cc8c8f6958
Summary: For clean-up and in preparation for some other anticipated changes, including * A new dynamically-scaling variant of HyperClockCache * SecondaryCache support for HyperClockCache This change does some refactoring for current and future code sharing and reusability. (Including follow-up on https://github.com/facebook/rocksdb/issues/10843) ## clock_cache.h * TBD whether new variant will be a HyperClockCache or use some other name, so namespace is just clock_cache for the family of structures. * A number of helper functions introduced and used. * Pre-emptively split ClockHandle (shared among lock-free clock cache variants) and HandleImpl (specific to a kind of Table), and introduce template to plug new Table implementation into ClockCacheShard. ## clock_cache.cc * Mostly using helper functions. Some things like `Rollback()` and `FreeDataMarkEmpty()` were not combined because `Rollback()` is Table-specific while `FreeDataMarkEmpty()` can be used with different table implementations. * Performance testing indicated that despite more opportunities for parallelism, making a local copy of handle data for processing after marking an entry empty was slower than doing that processing before marking the entry empty (but after marking it "under construction"), thus avoiding a few words of copying data. At least for now, this answers the "TODO? Delay freeing?" questions (no). Pull Request resolved: https://github.com/facebook/rocksdb/pull/10887 Test Plan: fixed a unit testing gap; other minor test updates for refactoring No functionality change ## Performance Same setup as https://github.com/facebook/rocksdb/issues/10801: Before: `readrandom [AVG 81 runs] : 627992 (± 5124) ops/sec` After: `readrandom [AVG 81 runs] : 637512 (± 4866) ops/sec` I've been getting some inconsistent results on restarts like the system is not being fair to the two processes, so I'm not sure there's such a real difference. Reviewed By: anand1976 Differential Revision: D40959240 Pulled By: pdillinger fbshipit-source-id: 0a8f3646b3bdb5bc7aaad60b26790b0779189949 |
||
---|---|---|
.. | ||
cache.cc | ||
cache_bench.cc | ||
cache_bench_tool.cc | ||
cache_entry_roles.cc | ||
cache_entry_roles.h | ||
cache_entry_stats.h | ||
cache_helpers.h | ||
cache_key.cc | ||
cache_key.h | ||
cache_reservation_manager.cc | ||
cache_reservation_manager.h | ||
cache_reservation_manager_test.cc | ||
cache_test.cc | ||
charged_cache.cc | ||
charged_cache.h | ||
clock_cache.cc | ||
clock_cache.h | ||
compressed_secondary_cache.cc | ||
compressed_secondary_cache.h | ||
compressed_secondary_cache_test.cc | ||
fast_lru_cache.cc | ||
fast_lru_cache.h | ||
lru_cache.cc | ||
lru_cache.h | ||
lru_cache_test.cc | ||
sharded_cache.cc | ||
sharded_cache.h |