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

Replace Map<Integer, Object> by primitive IntObjectHashMap. #13368

Merged
merged 3 commits into from
May 18, 2024

Conversation

bruno-roustant
Copy link
Contributor

Also replace some Map<Integer, Integer> by IntIntHashMap, if they don't rely on null value.

The goal is to gain globally some memory, maybe some perf on some spots that call the map intensively, with a replacement that does not seem to bring complexity. Most of the time it consists in changing a field type to the primitive map, and the call to the map constructor.
If some areas shouldn't be modified, we can exclude them from the replacement.

Replace some Map<Integer, Integer> by IntIntHashMap.
}

builders.computeIfAbsent(root.length, __ -> new SectionBuilder()).add(entry);
SectionBuilder builder;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only spot where the replacement brings some complexity. It does not seem too complex to me, so I kept it.

@bruno-roustant bruno-roustant merged commit 7db9c8c into apache:main May 18, 2024
4 checks passed
@bruno-roustant bruno-roustant deleted the primitive_map branch May 18, 2024 12:42
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