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

Avoid Object2LongMap.Entry allocations #8362

Merged
merged 3 commits into from
Feb 14, 2025

Conversation

embeddedt
Copy link
Contributor

Small tweaks to reduce the number of entries that get allocated on each server tick when updating the cached stacks.

A number of remaining allocations here appear to be from

return getRecords().object2LongEntrySet().iterator();
. Ideally that should use Object2LongMaps.fastIterator, but I am not sure if doing so is safe, since I'm not familiar with the rest of the code.

@shartte
Copy link
Member

shartte commented Feb 14, 2025

I checked all iterable uses of KeyCounter and found no case where its entry was in some way stored outside of the for-loop. I think we're good with using the fast entry set there too. Addons may do it, but I doubt it.

@shartte shartte enabled auto-merge (squash) February 14, 2025 19:21
@shartte shartte merged commit 1853dac into AppliedEnergistics:main Feb 14, 2025
2 checks passed
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