Skip to content

Use IntArrayList/IntHashSet to replace usages of List/Set of Integer - #14774

Merged
easyice merged 6 commits into
apache:mainfrom
easyice:replace_list_to_hppc
Jun 16, 2025
Merged

Use IntArrayList/IntHashSet to replace usages of List/Set of Integer#14774
easyice merged 6 commits into
apache:mainfrom
easyice:replace_list_to_hppc

Conversation

@easyice

@easyice easyice commented Jun 12, 2025

Copy link
Copy Markdown
Contributor

No functional changes — only optimization to reduce auto-boxing. However, this involves a public API change in UpdateGraphsUtils#computeJoinSet. not sure whether we should touch this public API?

@github-actions

Copy link
Copy Markdown
Contributor

This PR does not have an entry in lucene/CHANGES.txt. Consider adding one. If the PR doesn't need a changelog entry, then add the skip-changelog label to it and you will stop receiving this reminder on future updates to the PR.

@dweiss dweiss left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. I think it's fine to change the signature of those low-level methods.

@benwtrent benwtrent left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you add a change log note? I realize that this is more of a refactoring/performance thing.

* @return a set of nodes that best cover the graph
*/
public static Set<Integer> computeJoinSet(HnswGraph graph) throws IOException {
public static IntHashSet computeJoinSet(HnswGraph graph) throws IOException {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Honestly, this whole class should be marked as internal.

I think making this change is perfectly fine.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the guidance. I’ve added @lucene.internal for this class.

@easyice

easyice commented Jun 14, 2025

Copy link
Copy Markdown
Contributor Author

@dweiss @benwtrent Thanks for the quick review, I have added the CHANGES entry under 10.3.0

@github-actions github-actions Bot added this to the 10.3.0 milestone Jun 14, 2025
# Conflicts:
#	lucene/CHANGES.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants