Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is BigHash.Bucket.Slot.Size and BlockCache.Region.Entry.EntryDesc.KeyHash do not need serialize to disk. #82

Closed
SwordHoly opened this issue Nov 25, 2021 · 3 comments

Comments

@SwordHoly
Copy link

BigHashSlotSize
BlockCacheSize
As upper pictures shows, BigHash.Bucket.Slot.Size can be calculated by Slot.BucketEntry.KeySize + Slot.BucketEntry.ValueSize, BlockCache.Region.Entry.EntryDesc.KeyHash can be calculated from BlockCache.Region.Entry.EntryValue.Key. So I think it's do not need to serialize BigHash.Bucket.Slot.Size and BlockCache.Region.Entry.EntryDesc.KeyHash, and can save disk space. Especially BigHash is for smallItem, maybe KeySize and ValueSize is jiust 1 byte, the 4 bytes size overhead is not small.

@sunnyszy
Copy link

BTW @SwordHoly the slides look very nice. Can you share the full version? I could not find them by search.

@leozzx
Copy link
Contributor

leozzx commented Nov 29, 2021

I think this is to reduce the cpu cost during lookup, the disk space is not a top constraint comparing to cpu and memory.
Adding up to you, there's also an 8 bytes keyHash inside the BucketEntry.

@SwordHoly
Copy link
Author

I think this is to reduce the cpu cost during lookup, the disk space is not a top constraint comparing to cpu and memory. Adding up to you, there's also an 8 bytes keyHash inside the BucketEntry.

Thanks for replay, i think cpu cost for calucate SlotSize from KeySize and ValueSize is also very small, maybe cachelib do this is just for code hierarchy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants