-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Conversation
c03db56
to
722c64a
Compare
722c64a
to
ac35e69
Compare
maven-slf4j-provider/src/main/java/org/slf4j/impl/MavenSimpleLogger.java
Outdated
Show resolved
Hide resolved
maven-slf4j-provider/src/main/java/org/slf4j/impl/MavenSimpleLogger.java
Outdated
Show resolved
Hide resolved
93599de
to
ceaf0a2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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
2f95a2a
to
6888b8e
Compare
api/maven-api-core/src/main/java/org/apache/maven/api/services/MessageBuilder.java
Show resolved
Hide resolved
There was a problem hiding this 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
?
maven-slf4j-provider/src/main/java/org/slf4j/impl/MavenSimpleLogger.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
https://issues.apache.org/jira/browse/MNG-7899
Multiple optimizations :
strings on each call
temporary strings creation
PrintStream.print() calls to reduce temporary strings creation
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.
[X ] I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004
[X ] In any other case, please file an Apache Individual Contributor License Agreement.