Skip to content

Conversation

ChrisHegarty
Copy link
Contributor

This commit optimises the implementation of dotCount, in order to avoid costly walking each character. The implementation change is small, but defers to String::indexOf, which is backed by a vectorized JVM Hotspot intrinsic.

I noticed this method showing up in cpu profiles, in some cases consuming ~2% when there are even no fields with dots! After the change this mostly drops away. For example,

Screenshot 2025-09-23 at 11 45 17

@ChrisHegarty ChrisHegarty added :Search Foundations/Mapping Index mappings, including merging and defining field types :Performance All issues related to Elasticsearch performance including regressions and investigations Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch v9.2.0 labels Sep 23, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-perf (Team:Performance)

@elasticsearchmachine elasticsearchmachine added the Team:Performance Meta label for performance team label Sep 23, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine
Copy link
Collaborator

Hi @ChrisHegarty, I've created a changelog YAML for you.

Copy link
Contributor

@romseygeek romseygeek left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@benwtrent benwtrent left a comment

Choose a reason for hiding this comment

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

🚀

@ChrisHegarty ChrisHegarty merged commit 32ff026 into elastic:main Sep 24, 2025
34 checks passed
@ChrisHegarty ChrisHegarty deleted the dotCount branch September 24, 2025 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>enhancement :Performance All issues related to Elasticsearch performance including regressions and investigations :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Performance Meta label for performance team Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants