-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Misc aggregation performance improvements #19910
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -389,7 +389,7 @@ where | |
| // is value is already present in the set? | ||
| let entry = self.map.find_mut(hash, |header| { | ||
| // compare value if hashes match | ||
| if header.len != value_len { | ||
| if header.hash != hash { | ||
| return false; | ||
| } | ||
| // value is stored inline so no need to consult buffer | ||
|
|
@@ -427,7 +427,7 @@ where | |
| // Check if the value is already present in the set | ||
| let entry = self.map.find_mut(hash, |header| { | ||
| // compare value if hashes match | ||
| if header.len != value_len { | ||
| if header.hash != hash { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should save some random access if a lot of values share the same length |
||
| return false; | ||
| } | ||
| // Need to compare the bytes in the buffer | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -273,11 +273,10 @@ where | |
| let value: &[u8] = value.as_ref(); | ||
|
|
||
| let entry = self.map.find_mut(hash, |header| { | ||
| let v = self.builder.get_value(header.view_idx); | ||
|
|
||
| if v.len() != value.len() { | ||
| if header.hash != hash { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should save some random access if a lot of values share the same length |
||
| return false; | ||
| } | ||
| let v = self.builder.get_value(header.view_idx); | ||
|
|
||
| v == value | ||
| }); | ||
|
|
||
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.
Comment says "compare value if hashes match" but actual implementation is comparing lengths 🤔