-
Notifications
You must be signed in to change notification settings - Fork 89
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
Reduce size of EntryIndex
#206
Conversation
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you describe what you change to reduce the size
src/memtable.rs
Outdated
assert_eq!(idx.index, last_index + 1); | ||
} | ||
last_index = Some(idx.index); | ||
// if let Some(last_index) = last_index { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why comment out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for this check because entry index doesn't store log index anymore.
@@ -36,9 +36,9 @@ pub struct EntryIndex { | |||
pub compression_type: CompressionType, | |||
|
|||
/// The relative offset within its group of entries. | |||
pub entry_offset: u64, | |||
pub entry_offset: u32, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrap ThinEntryIndex
directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No because ThinEntryIndex
should be a private struct internal to MemTable
.
Signed-off-by: tabokie <xy.tao@outlook.com>
Codecov Report
@@ Coverage Diff @@
## master #206 +/- ##
==========================================
- Coverage 96.98% 96.95% -0.04%
==========================================
Files 28 28
Lines 7602 7652 +50
==========================================
+ Hits 7373 7419 +46
- Misses 229 233 +4
Continue to review full report at Codecov.
|
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
Ref #205
Some enhancements:
EntryIndex
.Size for one
EntryIndex
is reduced from 64 bytes to 48 bytes (25%).stress benchmarks shows 18.7% improvement (compared to results in #207, normalized with write bandwidth):