Skip to content

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

Merged
rmuir merged 20 commits intoelastic:masterfrom
rmuir:more_def_cleanup
Jun 15, 2016
Merged

fix bugs in operators and more improvements for the dynamic case#18899
rmuir merged 20 commits intoelastic:masterfrom
rmuir:more_def_cleanup

Conversation

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

4 participants