Skip to content

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

Merged
rmuir merged 2 commits intoelastic:masterfrom
rmuir:easy_win
May 5, 2016
Merged

painless: optimize/simplify dynamic field and method access#18151
rmuir merged 2 commits intoelastic:masterfrom
rmuir:easy_win

Conversation

@rmuir
Copy link
Copy Markdown
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
Copy Markdown
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