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

fix bugs in operators and more improvements for the dynamic case #18899

Merged
merged 20 commits into from Jun 15, 2016

Conversation

rmuir
Copy link
Contributor

@rmuir rmuir commented Jun 15, 2016

Fix a few bugs:

  • static compound assignment/shift had bugs (would allow bogus stuff)
  • dynamic compound assignments are consistent with static case. This never worked ever, it would always promote. Now it works.

Improve some performance:

  • dynamic xor was done in a slow way
  • remove null guard from + operator when we have enough type info to know its invalid
  • add megamorphic cache (from @uschindler !) so we have a legit performant fallback

Add lots of tests.

I tested the benchmark script by disabling some caches manually:

  • inline cache: 0.45s
  • megamorphic cache: 0.82s
  • no caches: 3.65s

So Uwe's cache really helps the worst case scenario, where tons of types are seen. Its no longer trappy now :)


/**
* Called when a new type is encountered (or, when we have encountered more than {@code MAX_DEPTH}
* types at this call site and given up on caching using this fallback wand we switch to a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think 'wand' should be 'and' here?

@jdconrad
Copy link
Contributor

This looks awesome! +1 Thanks @rmuir and @uschindler

@jdconrad jdconrad mentioned this pull request Jun 15, 2016
18 tasks
@rmuir rmuir merged commit 154d750 into elastic:master Jun 15, 2016
@rmuir
Copy link
Contributor Author

rmuir commented Jun 15, 2016

Thanks for tackling that cache @uschindler !

@rmuir rmuir mentioned this pull request Jun 16, 2016
@clintongormley clintongormley added the :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache label 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-alpha4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants