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: Use MethodHandle to prevent autoboxing allocations #47

Merged
merged 3 commits into from
May 20, 2024

Conversation

szuend
Copy link

@szuend szuend commented May 20, 2024

With MethodHandle.invokeExact we can skip the autoboxing allocations from the BCRenderTESR when a player is looking at logistic pipes. These allocations accounted for 5MB+ over a minute in a test world.

With MethodHandle.invokeExact we can skip the autoboxing allocations
from the BCRenderTESR when looking at logistic pipes. These allocations
accounted for 5MB+ over a minute in a test world.

Co-authored-by: Raven Szewczyk <git@eigenraven.me>
@eigenraven eigenraven merged commit e3774f3 into GTNewHorizons:master May 20, 2024
2 checks passed
@szuend szuend deleted the method-handles branch May 20, 2024 17:08
Dream-Master pushed a commit that referenced this pull request May 20, 2024
* refactor: Use MethodHandle to prevent autoboxing allocations

With MethodHandle.invokeExact we can skip the autoboxing allocations
from the BCRenderTESR when looking at logistic pipes. These allocations
accounted for 5MB+ over a minute in a test world.

Co-authored-by: Raven Szewczyk <git@eigenraven.me>

* Make MethodHandles static

* cleanup: Replace try/catch with @SneakyThrows and use varargs instead of array

---------

Co-authored-by: Raven Szewczyk <git@eigenraven.me>
(cherry picked from commit e3774f3)
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

Successfully merging this pull request may close these issues.

2 participants