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

HMGraphCache boxes a lot of integers #196

Closed
dlg99 opened this issue Jan 29, 2024 · 2 comments · Fixed by #202
Closed

HMGraphCache boxes a lot of integers #196

dlg99 opened this issue Jan 29, 2024 · 2 comments · Fixed by #202
Assignees

Comments

@dlg99
Copy link
Contributor

dlg99 commented Jan 29, 2024

private final Map<Integer, CachedNode> cache;

can be replaced with something like netty's io.netty.util.collection.IntObjectHashMap or similar to reduce this.

From JFR:

Class		Alloc Total	Total Allocation (%)
java.lang.Integer	1.2357043928E10 B	4.578557174712677 %		

There is no clear stack where the Integers are created, but this map is one of the suspect.

@jkni
Copy link
Collaborator

jkni commented Jan 30, 2024

This seems worth addressing. Given the number of hops in our caching graph indexes and the boxing overhead, this could definitely be sizable allocation/heap footprint waste. When I tested specialized collections earlier to evaluate latency advantages, both fastutil and Eclipse Collections looked like strong candidates.

@jbellis
Copy link
Owner

jbellis commented Jan 30, 2024

I'm down for either fastutil (which has fastutil-concurrent-wrapper available as well) or agrona (which is what C* uses).

@jkni jkni self-assigned this Jan 31, 2024
@jkni jkni linked a pull request Feb 2, 2024 that will close this issue
@jkni jkni closed this as completed in #202 Feb 2, 2024
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 a pull request may close this issue.

3 participants