-
Notifications
You must be signed in to change notification settings - Fork 24.6k
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
Hot methods redux #19016
Hot methods redux #19016
Conversation
This commit refactors InternalEngine#innerIndex and InternalEngine#innerDelete to collapse some common logic into a single method. This has the advantage that it shrinks the bytecode size of InternalEngine#innerIndex so that it can be inlined.
byte[] value = new byte[bytesSize]; | ||
readBytes(value, 0, bytesSize); | ||
return value; | ||
return fastReadByteArray(); |
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 "fast"?
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.
@jpountz Because there is already a method named readByteArray
and that method reads a single byte at a time but the method here uses readBytes
which can be optimized to read a chunk of bytes. I think that these methods can be combined but will address that in a follow-up if so to keep this PR purely about inlining.
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 was addressed #19023.
Looks fine to me, I think it even makes things slightly more readable. |
Agree! Thanks for reviewing! |
This pull request addresses some additional hot methods that could not
be inlined due to exceeding
MaxFreqInlineSize
. In particular, thispull request addresses all hot methods in the indexing path of the Rally
default benchmarking run:
Relates #16725