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

painless: optimize/simplify dynamic field and method access #18151

Merged
merged 2 commits into from
May 5, 2016

Conversation

rmuir
Copy link
Contributor

@rmuir rmuir commented May 5, 2016

The current code checks each classes hash twice. This results in more hash lookups than we really need. Also I think using 'return' instead of 'break' here just makes the code easier to read.

for dynamic access speedup is as high as 20%. this codepath will always be the worst case, even if we add fancy stuff to avoid it later.

@jdconrad can you look?

@rmuir rmuir added :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache :Engine v5.0.0-alpha3 labels May 5, 2016
@jdconrad
Copy link
Contributor

jdconrad commented May 5, 2016

LGTM.

@rmuir rmuir added >enhancement and removed :Engine labels May 5, 2016
@rmuir rmuir merged commit 66e8529 into elastic:master May 5, 2016
@jdconrad jdconrad mentioned this pull request May 5, 2016
18 tasks
@clintongormley clintongormley added :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache and removed :Plugin Lang Painless labels Feb 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Scripting Scripting abstractions, Painless, and Mustache >enhancement v5.0.0-alpha3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants