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

TableStoreWrite.lock reduce method length #1400

Closed
tgd opened this issue Aug 1, 2023 · 0 comments
Closed

TableStoreWrite.lock reduce method length #1400

tgd opened this issue Aug 1, 2023 · 0 comments
Assignees

Comments

@tgd
Copy link
Contributor

tgd commented Aug 1, 2023

Simplify this method and reduce its length to bring its bytecode length under 325 bytes (-XX:FreqInlineSize=325) to give it a better chance of being inlined during JIT compilation.

Before

Before this change the lock method had a bytecode length greater than 325 bytes. A benchmark was setup to run an appender in a tight loop ensuring sufficient time for compilation. The compilation log was captured including inlining information. The only methods that were inlined from within the TableStoreWriteLock class are shown below - note that lock was not inlined:

before-optimisation

After

After the refactor of the lock method and its new associated sub-methods the same benchmark was re-run and we can observe lock being appropriately inlined:

compilation-output-inlining

The output of jclasslib showing the length of the bytecode is shown below:

updated-method-length

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant