Increase embedded string threshold from 64 to 128 bytes#3397
Increase embedded string threshold from 64 to 128 bytes#3397zuiderkwast merged 3 commits intovalkey-io:unstablefrom
Conversation
Signed-off-by: Nikhil Manglore <[email protected]>
e38f9c1 to
9d808ac
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## unstable #3397 +/- ##
============================================
+ Coverage 76.38% 76.52% +0.13%
============================================
Files 159 159
Lines 79681 79680 -1
============================================
+ Hits 60865 60972 +107
+ Misses 18816 18708 -108
🚀 New features to boost your workflow:
|
|
Benchmark ran on this commit: RPS Benchmark Comparison: unstable vs 16d2c422 significant change(s)
14 with no significant change Click to expand full comparison tablesdata_size = 16
data_size = 96
Configuration:
Legend:
Statistical Notes:
|
|
+31% performance is wild, to the point of being suspicious. What's going on there? I want to see if it's repeatable |
|
Benchmark ran on this commit: RPS Benchmark Comparison: unstable vs a75d3443 significant change(s)
13 with no significant change Click to expand full comparison tablesdata_size = 16
data_size = 96
Configuration:
Legend:
Statistical Notes:
|
|
I'm very curious why this is producing a 31% performance gain, but I'm not complaining either 😆 |
|
That's quite a gain. Curious if this is because that 96 bytes value is now treated as Explanation from Codex about the total size of the |
Signed-off-by: Nikhil Manglore <[email protected]>
|
The tests |
There was a problem hiding this comment.
The jemalloc size classes in this range are in intervals of 16 bytes (64, 80, 96, 112, 128) so in the worst case, we get 15 bytes internal fragmentation in the allocation, but we save 8 bytes for the pointer.
Previously, for unembedded strings in the range 64-128, the internal fragmentation is up 15 bytes (for 96B strings, 100B sds representation, 112B bucket, wasted 12B) plus the fixed 8 bytes for the obj->ptr.
Also optimal performance in most cases, it seems. 💯
sarthakaggarwal97
left a comment
There was a problem hiding this comment.
LGTM! We should also change our performance benchmarks to include more string sizes after this PR gets merged.
Yeah 96 byte values are now treated as |
This PR increases the embedded string threshold to 128 bytes (2 cache lines) in order to improve memory overhead. I also fixed the tests that pertained to embedded values
Closes #3025