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

Fix inefficient org.elasticsearch.index.mapper.Mapper#getTotalFieldsCount implementations #119555

Conversation

original-brownbear
Copy link
Member

This is eating up a lot of CPU when creating indices and visibly slowing down many-shards benchmarks. Looking the profiling the cost of these implementations is almost exclusively the cost of the stream abstraction overhead (because we needlessly create the stream for every field mapper). Keeping it simple and using iterators almost completely removes the cost of this thing from profiling.

…ount implementations

This is eating up a lot of CPU when creating indices and visibly slowing
down many-shards benchmarks. Looking the profiling the cost of these
implementations is almost exclusively the cost of the stream abstraction
overhead (because we needlessly create the stream for every field mapper).
Keeping it simple and using iterators almost completely removes the cost
of this thing from profiling.
@original-brownbear original-brownbear added >non-issue :Search Foundations/Mapping Index mappings, including merging and defining field types labels Jan 4, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch label Jan 4, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@original-brownbear original-brownbear added auto-backport Automatically create backport pull requests when merged v8.18.0 labels Jan 4, 2025
@original-brownbear
Copy link
Member Author

Thanks Felix!

@original-brownbear original-brownbear merged commit 7d95699 into elastic:main Jan 4, 2025
16 checks passed
@original-brownbear original-brownbear deleted the fix-inefficient-field-counting branch January 4, 2025 16:10
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.x

original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request Jan 4, 2025
…ount implementations (elastic#119555)

This is eating up a lot of CPU when creating indices and visibly slowing
down many-shards benchmarks. Looking the profiling the cost of these
implementations is almost exclusively the cost of the stream abstraction
overhead (because we needlessly create the stream for every field mapper).
Keeping it simple and using iterators almost completely removes the cost
of this thing from profiling.
elasticsearchmachine pushed a commit that referenced this pull request Jan 4, 2025
…ount implementations (#119555) (#119557)

This is eating up a lot of CPU when creating indices and visibly slowing
down many-shards benchmarks. Looking the profiling the cost of these
implementations is almost exclusively the cost of the stream abstraction
overhead (because we needlessly create the stream for every field mapper).
Keeping it simple and using iterators almost completely removes the cost
of this thing from profiling.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged >non-issue :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants