-
Notifications
You must be signed in to change notification settings - Fork 25.6k
lang-expressions should use DoubleValuesSource #53661
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
lang-expressions should use DoubleValuesSource #53661
Conversation
|
Pinging @elastic/es-core-infra (:Core/Infra/Scripting) |
|
Note that this also means that we don't need to depend on |
rjernst
left a comment
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.
LGTM
This dependency is in |
jdconrad
left a comment
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.
LGTM too. Thanks for changing this.
DoubleValuesSource is the type-safe replacement for ValueSource in the lucene core. Most of elasticsearch has moved to use these, but lang-expressions is still using the old version. This commit migrates lang-expressions as well.
After commit #53661 converted the lang-expressions module to using DoubleValuesSource, we've seen a performance regression for expressions that use geopoints. Some investigation suggests that this may be due to GeoLatitudeValueSource and GeoLongitudeValueSource wrapping their per-document values in a DoubleValues.withDefault() class. Values exposed via expressions already have a '0' default value, so this extra wrapping is unnecessary, and is directly on the hot path. This commit removes the extra wrapping.
After commit #53661 converted the lang-expressions module to using DoubleValuesSource, we've seen a performance regression for expressions that use geopoints. Some investigation suggests that this may be due to GeoLatitudeValueSource and GeoLongitudeValueSource wrapping their per-document values in a DoubleValues.withDefault() class. Values exposed via expressions already have a '0' default value, so this extra wrapping is unnecessary, and is directly on the hot path. This commit removes the extra wrapping.
DoubleValuesSource is the type-safe replacement for ValueSource in the lucene
core. Most of elasticsearch has moved to use these, but lang-expressions is still
using the old version. This commit migrates lang-expressions as well.