-
Notifications
You must be signed in to change notification settings - Fork 408
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
LogstashMarker refactoring #636
Conversation
Most Logstash marker don't have any children/reference at all. Creating the referenceList upfront is a waste of memory and additional pressure on the GC. This commit modifies the implementation to create the reference list when the first reference is added.
This class is now our own implementation - remove copy of SLF4J copyright notice
@philsttr |
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.
@philsttr EmptyLogstashMarker does not override equals/hascode. Equality is therefore solely on the marker name. Most (if not all) other logstash markers also require that "other" is of the exact same class. Shouldn't it be the case here as well ?
Yes, please add a check for the same class.
src/main/java/net/logstash/logback/marker/LogstashBasicMarker.java
Outdated
Show resolved
Hide resolved
src/main/java/net/logstash/logback/marker/MapEntriesAppendingMarker.java
Outdated
Show resolved
Hide resolved
src/main/java/net/logstash/logback/argument/DeferredStructuredArgument.java
Show resolved
Hide resolved
contains() should accept null values and return false in this case. Calling code will not have to test for nullability before using the method and still have a consistent result
Revert changes made to equals() in f29bb2c
Most Logstash marker don't have any children/reference at all. Creating the referenceList upfront is a waste of memory and additional pressure on the GC. This PR modifies the implementation to create the reference list eagerly when the first reference is added. See #617 (comment) for the motivations behind this change.