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 NumberFieldMapper Referencing its Own Builder #77131

Merged

Conversation

original-brownbear
Copy link
Member

Investigating the heap use of mapper instances I found this.
It seems quite a bit of overhead for these instances goes into
the builder field. In other mappers we retain the script service
and the script outright, so I did the same thing here to make these
instances a little smaller.

Investigating the heap use of mapper instances I found this.
It seems quite a bit of overhead for these instances goes into
the builder field. In other mappers we retain the script service
and the script outright, so I did the same thing here to make these
instances a little smaller.
@original-brownbear original-brownbear added >non-issue :Search Foundations/Mapping Index mappings, including merging and defining field types v8.0.0 v7.16.0 labels Sep 1, 2021
@elasticmachine elasticmachine added the Team:Search Meta label for search team label Sep 1, 2021
@elasticmachine
Copy link
Collaborator

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

Copy link
Contributor

@jtibshirani jtibshirani left a comment

Choose a reason for hiding this comment

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

This makes sense to me! I did a search for this.builder = builder in classes named *FieldMapper and noticed we do this frequently, including popular types like match_only_text. Would it make sense to expand this to a broader change?

@jpountz
Copy link
Contributor

jpountz commented Sep 1, 2021

@romseygeek I think you investigated a very similar issue a few months ago?

@original-brownbear
Copy link
Member Author

Would it make sense to expand this to a broader change?

Right, didn't even notice that :) Makes sense to me, unless @romseygeek has objections? :)

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.

@yannick found a similar problem with text fields using this pattern a few weeks ago. We should definitely fix it - I have a longer term plan to rework how merges are done so that we only use builders and don't need to hold references to all these helper components but in the short term this is a good fix.

@original-brownbear
Copy link
Member Author

Thanks @romseygeek !

@original-brownbear original-brownbear merged commit c082c25 into elastic:master Sep 2, 2021
@original-brownbear original-brownbear deleted the smaller-num-field-mapper branch September 2, 2021 08:26
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request Sep 2, 2021
Investigating the heap use of mapper instances I found this.
It seems quite a bit of overhead for these instances goes into
the builder field. In other mappers we retain the script service
and the script outright, so I did the same thing here to make these
instances a little smaller.
@ywelsch
Copy link
Contributor

ywelsch commented Sep 2, 2021

Relates #73845

original-brownbear added a commit that referenced this pull request Sep 2, 2021
Investigating the heap use of mapper instances I found this.
It seems quite a bit of overhead for these instances goes into
the builder field. In other mappers we retain the script service
and the script outright, so I did the same thing here to make these
instances a little smaller.
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request Sep 2, 2021
Just like elastic#77131 but for the `MatchOnlyTextFieldMapper`. Also, cleaned up a few
other minor things in it to make the constructor code for this class easier to follow.
original-brownbear added a commit that referenced this pull request Sep 3, 2021
…7201)

Just like #77131 but for the `MatchOnlyTextFieldMapper`. Also, cleaned up a few
other minor things in it to make the constructor code for this class easier to follow.
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request Sep 3, 2021
…astic#77201)

Just like elastic#77131 but for the `MatchOnlyTextFieldMapper`. Also, cleaned up a few
other minor things in it to make the constructor code for this class easier to follow.
original-brownbear added a commit that referenced this pull request Sep 3, 2021
…7201) (#77233)

Just like #77131 but for the `MatchOnlyTextFieldMapper`. Also, cleaned up a few
other minor things in it to make the constructor code for this class easier to follow.
@original-brownbear original-brownbear restored the smaller-num-field-mapper branch April 18, 2023 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>non-issue :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Meta label for search team v7.16.0 v8.0.0-alpha2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants