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

added lazy initialization to improve withDefaultPlugins performance #194

Merged
merged 3 commits into from
Aug 17, 2020

Conversation

willarmiros
Copy link
Contributor

Issue #, if available:
#117

Description of changes:
In order to improve the time it takes to quickly construct and check isEnabled on all plugins, I adjusted a couple other plugins to fail faster (related to #192):

  • In ElasticBeanstalkPlugin, made ObjectMapper initialization lazy
  • In EKSPlugin, made call to getClusterName lazy

Also reduced logging level for missing log groups to debug, since log group discovery is not yet implemented for all plugins and we shouldn't emit a warning in that case.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.


// lazily initialize for performance on unused plugins
if (OBJECT_MAPPER == null) {
OBJECT_MAPPER = new ObjectMapper();
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is only called once anyways I guess there's no point in even having a static variable if we're lazying

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah sorry I meant we can just have local variable

ObjectMapper objectMapper = new ObectMapper();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see my bad.

@willarmiros willarmiros merged commit af2fb0b into aws:master Aug 17, 2020
@willarmiros willarmiros deleted the cold-starts branch August 17, 2020 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants