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

Refactor RunLengthEncodedBlock hash combination logic #19759

Merged
merged 1 commit into from
Nov 20, 2023

Conversation

pettyjamesm
Copy link
Member

@pettyjamesm pettyjamesm commented Nov 15, 2023

Description

Refactors RunLengthEncodedBlock column-wise hash calculations to call a common implementation of the hash combination loop instead of directly embedding the same loop logic in each method of generated code. This reduces overall code size and JIT warm-up time for RLE hash handling.

Additional context and related issues

Follows up from #19723

Release notes

(x) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:

@pettyjamesm pettyjamesm requested a review from dain November 15, 2023 19:28
@cla-bot cla-bot bot added the cla-signed label Nov 15, 2023
@pettyjamesm pettyjamesm marked this pull request as ready for review November 15, 2023 20:03
@pettyjamesm pettyjamesm requested a review from martint November 17, 2023 21:19
Comment on lines +460 to +467
BytecodeExpression setHashExpression;
if (field.index() == 0) {
// hashes[index] = hash;
setHashExpression = hashes.setElement(index, hash);
}
else {
// hashes[index] = CombineHashFunction.getHash(hashes[index], hash);
setHashExpression = hashes.setElement(index, invokeStatic(CombineHashFunction.class, "getHash", long.class, hashes.getElement(index), hash));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did this move?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously, the same hash assignment expression was used in the RLE loop as well as the normal block loop, so it was declared above both of them (RLE loop was defined first). Now it's only used in the normal block loop, so I moved it closer to it's usage site.

@pettyjamesm pettyjamesm force-pushed the simplify-rle-combine-hash branch from b885a29 to f9690fc Compare November 18, 2023 21:37
@pettyjamesm pettyjamesm merged commit 142cc78 into trinodb:master Nov 20, 2023
@pettyjamesm pettyjamesm deleted the simplify-rle-combine-hash branch November 20, 2023 14:11
@github-actions github-actions bot added this to the 434 milestone Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants