Skip to content

Conversation

@jordan-powers
Copy link
Contributor

@jordan-powers jordan-powers commented Oct 21, 2025

Some recent profiling showed that compiling the mapping_includes filter in LogsdbIndexModeSettingsProvider#getMappingHints was very expensive. This PR moves that work so that it only happens once, when the class is constructed.

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-storage-engine (Team:StorageEngine)

@jordan-powers jordan-powers added auto-backport Automatically create backport pull requests when merged v9.2.1 and removed v9.2.1 labels Oct 21, 2025
@masseyke
Copy link
Member

For what it's worth, here's a flamegraph from ingest simulate, starting with the call to TransportSimulateIndexTemplateAction.resolveTemplate. The right 40% or so is LogsdbIndexModeSettingsProvider.provideAdditionalSettings():
Screenshot 2025-10-21 at 4 57 29 PM

@masseyke
Copy link
Member

And here is the flamegraph for the same test on your branch (better as expected):
Screenshot 2025-10-21 at 5 09 39 PM

Copy link
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

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

LGTM

Maybe we can reduce the overhead more by moving away setting up mapper service and use MappingVisitor.visitMapping(...) more extensively. Like is done for patten_text?

@jordan-powers jordan-powers merged commit 17c9dc4 into elastic:main Oct 22, 2025
34 checks passed
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
9.2

jordan-powers added a commit to jordan-powers/elasticsearch that referenced this pull request Oct 22, 2025
elastic#136899)

Some recent profiling showed that compiling the mapping_includes filter in
LogsdbIndexModeSettingsProvider#getMappingHints was very expensive. This PR
moves that work so that it only happens once, when the class is
constructed
elasticsearchmachine pushed a commit that referenced this pull request Oct 22, 2025
#136899) (#136972)

Some recent profiling showed that compiling the mapping_includes filter in
LogsdbIndexModeSettingsProvider#getMappingHints was very expensive. This PR
moves that work so that it only happens once, when the class is
constructed
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 :StorageEngine/Logs You know, for Logs Team:StorageEngine v9.2.1 v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants