-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Pre-compile inline scripts in Ingest Script processors #57960
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
Conversation
This commit introduces an optimization for inline scripts. It keeps the compiled ingest script that the ScriptProcessor.Factory has been creating for validation purposes. Previously, the Script Service's cache was leveraged because it was the best way to handle caching of both stored and inline scripts. Since inline scripts are so widely used in Ingest Node, it is probably best to ensure we are using the pre-compiled version from the beginning.
Pinging @elastic/es-core-features (:Core/Features/Ingest) |
Pinging @elastic/es-core-infra (:Core/Infra/Scripting) |
Hey @stu-elastic and @jdconrad 👋! I was speaking to Ryan about this improvement for inline scripts in Ingest, and we thought it would be a welcomed change. I've been away from ingest and painless land for a while and felt like pushing the change through anyways. Mind reviewing it and letting me know if I'm misusing or not using any of the scripting tools right? thanks! |
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.
Script changes look good. Tests look good. Nice change.
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. I wonder if with this change we still need a (large?) cache for the ingest processor scripts since it's now being cached locally.
thanks for taking a look team!
that is up to you! the only thing I'll add is that caching is still being used for stored scripts. I do not know how much stored scripts are used in Ingest in practice. I suspect not a lot. It may be justified to remove support for stored scripts here entirely, but that will be breaking. Do you have any thoughts on that? |
@talevy I would like to removed stored scripts altogether, but I'm not sure that's a great idea, yet, especially considering some scripts are getting quite large. |
This commit introduces an optimization for inline scripts. It keeps the compiled ingest script that the ScriptProcessor.Factory has been creating for validation purposes. Previously, the Script Service's cache was leveraged because it was the best way to handle caching of both stored and inline scripts. Since inline scripts are so widely used in Ingest Node, it is probably best to ensure we are using the pre-compiled version from the beginning.
This commit introduces an optimization for inline scripts. It keeps the compiled ingest script that the ScriptProcessor.Factory has been creating for validation purposes. Previously, the Script Service's cache was leveraged because it was the best way to handle caching of both stored and inline scripts. Since inline scripts are so widely used in Ingest Node, it is probably best to ensure we are using the pre-compiled version from the beginning.
This commit introduces an optimization for inline scripts.
It keeps the compiled ingest script that the ScriptProcessor.Factory
has been creating for validation purposes. Previously, the Script Service's
cache was leveraged because it was the best way to handle caching of both
stored and inline scripts. Since inline scripts are so widely used in
Ingest Node, it is probably best to ensure we are using the pre-compiled version
from the beginning.