-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Fix NumberFieldMapper Referencing its Own Builder #77131
Conversation
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.
Pinging @elastic/es-search (Team:Search) |
There was a problem hiding this 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?
@romseygeek I think you investigated a very similar issue a few months ago? |
Right, didn't even notice that :) Makes sense to me, unless @romseygeek has objections? :) |
There was a problem hiding this 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.
Thanks @romseygeek ! |
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.
Relates #73845 |
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.
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.
…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.
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.