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

[MNG-7899] Various memory usage improvements 5 #1270

Merged
merged 3 commits into from
Oct 20, 2023

Conversation

sebastien-doyon
Copy link
Contributor

@sebastien-doyon sebastien-doyon commented Sep 26, 2023

https://issues.apache.org/jira/browse/MNG-7899
Multiple optimizations :

  • renderLevel() method use static constants instead of rebuilding the
    strings on each call
  • replace + operator usage with more PrintStream.print() calls to reduce
    temporary strings creation
  • reduce usage of MessageBuilder.a() method usage with more
    PrintStream.print() calls to reduce temporary strings creation
  • replace the builder() method with a static import

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

@sebastien-doyon sebastien-doyon changed the title [MNG-7899] Various memory usage improvements [MNG-7899] Various memory usage improvements 5 Sep 26, 2023
@sebastien-doyon sebastien-doyon force-pushed the MNG-7899_-_5 branch 2 times, most recently from c03db56 to 722c64a Compare September 27, 2023 14:14
Copy link
Contributor

@gnodet gnodet left a comment

Choose a reason for hiding this comment

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

LGTM

@gnodet gnodet added this to the 4.0.0-alpha-8 milestone Oct 20, 2023
Multiple optimizations :

- renderLevel() method use static constants instead of rebuilding the
strings on each call
- replace + operator usage with more PrintStream.print() calls to reduce
temporary strings creation
- reduce usage of MessageBuilder.a() method usage with more
PrintStream.print() calls to reduce temporary strings creation
- replace the builder() method with a static import
- Reduce PrintStream.print() calls
- replace String.format with a simple string concat to reduce memory
allocation (garbage)
- Change static constants to class member in MavenSimpleLogger
- Add a setLength(int) method in MessageBuilder to enable reuse
Copy link
Contributor

@gnodet gnodet left a comment

Choose a reason for hiding this comment

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

Maybe a last spot for enhancement in getLocation ?

Copy link
Contributor

@gnodet gnodet left a comment

Choose a reason for hiding this comment

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

LGTM

@gnodet gnodet merged commit d362690 into apache:master Oct 20, 2023
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants