You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2021/10/15 11:27:00 UTC

[jira] [Commented] (LOG4J2-3171) Reduce indirection/branching in PatternLayout to improve throughput

    [ https://issues.apache.org/jira/browse/LOG4J2-3171?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17429240#comment-17429240 ] 

ASF subversion and git services commented on LOG4J2-3171:
---------------------------------------------------------

Commit 3bb92e0f6fe9abf14d7ce161d916888e47ee8471 in logging-log4j2's branch refs/heads/release-2.x from Carter Kozak
[ https://gitbox.apache.org/repos/asf?p=logging-log4j2.git;h=3bb92e0 ]

LOG4J2-3171: Reduce PatternLayout + PatternConverter branching

Prefer fewer conditionals based on types known ahead of time.
Serializer extends Serializer2 with a default implementation
of the encode method -- all of our implementations of
the Serializer interface also implement Serializer2, so the
conditional path was never used. This may allow more code to
be inlined.

Simplify literal pattern converters to avoid overhead
Simplify LineSeparatorPatternConverter, non-variable, directly from static
unwrap PatternFormaters in PatternLayout

Split MessagePatternConverter into individual components
Complexity only exists in the call-path if it's needed. Note
that we are building a more complex object graph here, but
it should allow more effective inlining.

Remove verbose properties code from logger hot paths

LogEventFactory implements LocationAwareLogEventFactory to reduce
overhead due to branching on instanceof checks.

Factor out uncommon instance creation path in ReusableLogEventFactory


> Reduce indirection/branching in PatternLayout to improve throughput
> -------------------------------------------------------------------
>
>                 Key: LOG4J2-3171
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-3171
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Layouts
>    Affects Versions: 2.14.1
>            Reporter: Carter Kozak
>            Assignee: Carter Kozak
>            Priority: Major
>             Fix For: 2.15.0
>
>
> Ticket is meant to cover the work I've done in:
> https://github.com/apache/logging-log4j2/pull/573



--
This message was sent by Atlassian Jira
(v8.3.4#803005)