mapleFU commented on code in PR #2145:
URL: https://github.com/apache/kvrocks/pull/2145#discussion_r1518713881
##########
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:
Emm I think previously it's size is 8*8B=64B, now `sizeof(DBStats)` becomes
8 * 64B. Which would be a large object
--
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]