Skip to content

Cleanup some Inefficiencies in JavaDateFormatter (#84922) #89797

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

Merged
merged 1 commit into from
Sep 5, 2022

Conversation

pgomulka
Copy link
Contributor

@pgomulka pgomulka commented Sep 5, 2022

Fixes a couple of smaller inefficiencies that I found in profiling and otherwise.

  • Iteration over the parsers is faster if we just use an array.
  • Make some of the object construction more efficient since formats aren't always constants, like
    in e.g. the index name resolver.
  • Fix non-static initializer block running useless puts into the static mutable map on every instantiation
    • no need to even have the map, just inline what it does and save some code, indirection and the
      iteration over the mutable map

backports #84922

  • Have you signed the contributor license agreement?
  • Have you followed the contributor guidelines?
  • If submitting code, have you built your formula locally prior to submission with gradle check?
  • If submitting code, is your pull request against main? Unless there is a good reason otherwise, we prefer pull requests against main and will backport as needed.
  • If submitting code, have you checked that your submission is for an OS and architecture that we support?
  • If you are submitting this code for a class then read our policy for that.

Fixes a couple of smaller inefficiencies that I found in profiling and otherwise.
* Iteration over the parsers is faster if we just use an array.
* Make some of the object construction more efficient since formats aren't always constants, like
in e.g. the index name resolver.
* Fix non-static initializer block running useless puts into the static mutable map on every instantiation
  * no need to even have the map, just inline what it does and save some code, indirection and the
iteration over the mutable map
@pgomulka pgomulka self-assigned this Sep 5, 2022
@pgomulka pgomulka merged commit ff0db15 into elastic:7.17 Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants