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 List<Integer> by IntArrayList and List<Long> by LongArrayList. #13406

Merged
merged 5 commits into from
May 25, 2024

Conversation

bruno-roustant
Copy link
Contributor

@bruno-roustant bruno-roustant commented May 23, 2024

Add IntArrayList and LongArrayList to the HPPC fork.
Use them to replace usages of List of Integer or Long.

No functional changes, only optimization for less auto-boxing and more compact structures.
Also, no public API changes.

@bruno-roustant bruno-roustant requested a review from dweiss May 23, 2024 16:03
@@ -349,7 +350,7 @@ public boolean incrementToken() throws IOException {
* The last node in the alt path didn't arrive to remove this reference.
*/
assert inputNodes.get(inputFrom).tokens.isEmpty() : "about to remove non empty edge";
outSrc.inputNodes.remove(Integer.valueOf(inputFrom));
outSrc.inputNodes.remove(inputFrom);
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if it makes sense to rename this early to "removeElement", in the spirit of changes coming to HPPC?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch!
We discussed that name in HPPC after I wrote this line and I forgot to change here. Thanks.

Copy link
Contributor

@dweiss dweiss left a comment

Choose a reason for hiding this comment

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

LGTM.

@bruno-roustant bruno-roustant merged commit 444d4e7 into apache:main May 25, 2024
4 checks passed
@bruno-roustant bruno-roustant deleted the primitive_list branch May 25, 2024 17:54
jpountz added a commit to jpountz/lucene that referenced this pull request May 29, 2024
Pull request apache#13406 inadvertly broke Lucene's handling of tragic exceptions by
stopping after the first `DocValuesProducer` whose `close()` calls throws an
exception, instead of keeping calling `close()` on further producers in the
list.

This moves back to the previous behavior.

Closes apache#13434
jpountz added a commit that referenced this pull request May 29, 2024
Pull request #13406 inadvertly broke Lucene's handling of tragic exceptions by
stopping after the first `DocValuesProducer` whose `close()` calls throws an
exception, instead of keeping calling `close()` on further producers in the
list.

This moves back to the previous behavior.

Closes #13434
jpountz added a commit that referenced this pull request May 29, 2024
Pull request #13406 inadvertly broke Lucene's handling of tragic exceptions by
stopping after the first `DocValuesProducer` whose `close()` calls throws an
exception, instead of keeping calling `close()` on further producers in the
list.

This moves back to the previous behavior.

Closes #13434
jpountz added a commit that referenced this pull request May 29, 2024
Pull request #13406 inadvertly broke Lucene's handling of tragic exceptions by
stopping after the first `DocValuesProducer` whose `close()` calls throws an
exception, instead of keeping calling `close()` on further producers in the
list.

This moves back to the previous behavior.

Closes #13434
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