-
Notifications
You must be signed in to change notification settings - Fork 742
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
Replace dict with new hashtable for sets datatype #1176
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## unstable #1176 +/- ##
============================================
- Coverage 70.90% 66.64% -4.27%
============================================
Files 119 119
Lines 64631 64693 +62
============================================
- Hits 45828 43116 -2712
- Misses 18803 21577 +2774
|
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.
Partial review. I'll look more later.
60f3f70
to
add04d0
Compare
Sorry for force-pushing the hashset branch again, to fix a DCO issue. Can you rebase and force-push again? (I guess it's better than merge when we have a DCO issue following us.) |
add04d0
to
e9280d8
Compare
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.
This looks really good. Just a few nits.
e14257b
to
b5f01d1
Compare
63f785b
to
8aa2646
Compare
b5f01d1
to
3c30172
Compare
Thanks Viktor for taking care of the rebase - your changes look good to me. :) |
You're welcome. :) The main thing I don't like right now is OBJ_ENCODING_HT for dict vs OBJ_ENCODING_HASHTABLE for hashtable. Maybe we should rename the former to OBJ_ENCODING_DICT and the latter to OBJ_ENCODING_HT instead? |
That's a fair point, but OBJECT_ENCODING_HT will be removed completely when all data types have been converted to hashset, so it is only an issue short term, I think. I don't want to touch extra files just to rename it temporarily - I feel like that might make the PR more confusing and harder to review. :-/ |
c957864
to
d6da54f
Compare
Are you updating this? It becomes very hard to rebase it if you wait this long between each rebase. |
I did rebase about a week ago - might have forgotten to push. Ice just
finished my oncall shift and rebasing is at the top of my list. 🙂 really
looking forward to getting back to this
…On Fri, Dec 6, 2024, 1:09 PM Viktor Söderqvist ***@***.***> wrote:
Are you updating this? It becomes very hard to rebase it if you wait this
long between each rebase.
—
Reply to this email directly, view it on GitHub
<#1176 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE5RJXUR3JINHGJFX5BHW2L2EIHBFAVCNFSM6AAAAABQAK2CNWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMRUGE3TSMRRHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
d090f8e
to
3559ba8
Compare
3c30172
to
3eb8314
Compare
I rebased it (started from unstable and applied commit with cherry-pick) but then I forgot |
I got the PR fixed and back up - ready to review and merge! Thanks @zuiderkwast for your work rebasing this again. 😊 |
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.
Nits.
Changes to the merged code after code review include avoiding the cast to void **
. (Related to the strict aliasing rule or just nicer code?) We should do the corresponding changes here.
When I rebased, I just made it compile. I didn't update anything else, like hs
variable names.
1138fac
to
ded690a
Compare
Signed-off-by: Rain Valentine <[email protected]>
ded690a
to
22317e7
Compare
It seems like most of these check failures are also happening in unstable? :( |
Yes, it's not a blocker for this PR. We should fix them in unstable. |
The variable just means "a hashtable-backed set". It was used for dict and it's not wrong to use it for the new hashtable. Signed-off-by: Viktor Söderqvist <[email protected]>
The new `hashtable` provides faster lookups and uses less memory than `dict`. A TCL test case "SRANDMEMBER with a dict containing long chain" is deleted because it's covered by a hashtable unit test "test_random_entry_with_long_chain", which is already present. This change also moves some logic from dismissMemory (object.c) to zmadvise_dontneed (zmalloc.c), so the hashtable implementation which needs the dismiss functionality doesn't need to depend on object.c and server.h. This PR follows valkey-io#1186. --------- Signed-off-by: Rain Valentine <[email protected]> Signed-off-by: Viktor Söderqvist <[email protected]> Co-authored-by: Viktor Söderqvist <[email protected]>
The new
hashtable
provides faster lookups and uses less memory thandict
.A TCL test case "SRANDMEMBER with a dict containing long chain" is deleted because it's covered by a hashtable unit test "test_random_entry_with_long_chain", which is already present.
This change also moves some logic from dismissMemory (object.c) to zmadvise_dontneed (zmalloc.c), so the hashtable implementation which needs the dismiss functionality doesn't need to depend on object.c and server.h.
This PR follows #1186.