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

Remove some copying and slow sorting from search shard resolution #123426

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

original-brownbear
Copy link
Member

Removed one unnecessary sort (the shards are already sorted in the same order) and ported two more to JDK's list sort which beats Lucene's timsort by quite a margin nowadays (the mutations are done straight on the array backing the list and that saves endless indirection). Also, removed a needless intermediary to and from set copy and an unnecessary conditional.
This is all motivated by spacetime project benchmarking showing this stuff as one of the biggest contributors to search transport thread use.

Removed one unnecessary sort (the shards are already sorted in the same
order) and ported two more to JDK's list sort which beats Lucene's
timsort by quite a margin nowadays (the mutations are done straight on
the array backing the list and that saves endless indirection).
Also, removed a needless intermediary to and from set copy and an
unnecessary conditional.
This is all motivated by spacetime project benchmarking showing
this stuff as one of the biggest contributors to search transport
thread use.
@original-brownbear original-brownbear added >non-issue :Search Foundations/Search Catch all for Search Foundations labels Feb 25, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search-foundations (Team:Search Foundations)

@elasticsearchmachine elasticsearchmachine added Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch v9.1.0 labels Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>non-issue :Search Foundations/Search Catch all for Search Foundations Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants