Skip to content

Migrate linked list to more efficient datastructre#15704

Merged
uschindler merged 7 commits intoapache:mainfrom
renatoh:migrate_LinkedList_to_more_efficient_datastructre
Feb 26, 2026
Merged

Migrate linked list to more efficient datastructre#15704
uschindler merged 7 commits intoapache:mainfrom
renatoh:migrate_LinkedList_to_more_efficient_datastructre

Conversation

@renatoh
Copy link
Contributor

@renatoh renatoh commented Feb 12, 2026

I've replaced almost all LinkedList with an ArrayDeque or an ArrayList.
If elements are added/remove at the beginning or at the end, I replaced it with an ArrayDeque. If elements are accessed by index, I removed it with an ArrayList.
In rare cases, where it was use as a List and as a Queue, I left the LinkedList untouched.
I also took the liberty to do some small improvements and have removed some all commented out code. Please let me know it that is fine.

@renatoh
Copy link
Contributor Author

renatoh commented Feb 12, 2026

Hi @uschindler
I checked every instance of 'new LinkedList' and have replace most of them with either an ArrayDeque or an ArrayList. Please have a look. thanks!

@github-actions github-actions bot added this to the 11.0.0 milestone Feb 12, 2026
@renatoh
Copy link
Contributor Author

renatoh commented Feb 23, 2026

@uschindler Could you please have a look at my changes, thanks

@uschindler
Copy link
Contributor

Sorry for the delay, had a surgery and missed the remineder.

}
return accept;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

thanks for removing this :-)


/**
* FieldPhraseList has a list of WeightedPhraseInfo that is used by FragListBuilder to create a
* FieldFragList object.
Copy link
Contributor

Choose a reason for hiding this comment

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

should possible be marked @lucene.experimental

@uschindler uschindler self-assigned this Feb 24, 2026
@uschindler
Copy link
Contributor

I also took the liberty to do some small improvements and have removed some all commented out code. Please let me know it that is fine.

That's fine. Commented out code over several pages is bad habit before you had version control. If you want to remove code remove it, the history is still available in case something performs not good.

@uschindler uschindler merged commit 7335eb0 into apache:main Feb 26, 2026
14 checks passed
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.

2 participants