mapleFU commented on code in PR #2145:
URL: https://github.com/apache/kvrocks/pull/2145#discussion_r1518625593
##########
src/storage/storage.h:
##########
@@ -107,18 +108,18 @@ inline const std::vector<CacheOption> CacheOptions = {
{BlockCacheType::kCacheTypeHCC, "hcc", "kCacheTypeHCC"},
};
-enum class StatType {
+enum class StatType : uint_fast8_t {
CompactionCount,
FlushCount,
KeyspaceHits,
KeyspaceMisses,
};
-struct DBStats {
- std::atomic<uint64_t> compaction_count = 0;
- std::atomic<uint64_t> flush_count = 0;
- std::atomic<uint64_t> keyspace_hits = 0;
- std::atomic<uint64_t> keyspace_misses = 0;
+struct alignas(CACHE_LINE_SIZE) DBStats {
Review Comment:
Like rocksdb, an Per core array optimization can also be introduced here.
Maybe I'll try it in another patch.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]