[ 
https://issues.apache.org/jira/browse/LOG4J2-250?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Remko Popma resolved LOG4J2-250.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0-rc2

Fixed in revision 1597291.

JMH performance test shows that constructing a Log4jLogEvent with or without 
exception is now equally fast.

Sampled latency:
{code}
Benchmark                                              Mode   Samples         
Mean   Mean error    Units
o.a.l.l.p.j.Log4jLogEventBenchmark.testBaseline      sample     76486       
15.834        1.297    ns/op
o.a.l.l.p.j.Log4jLogEventBenchmark.testException     sample     52575      
123.071        3.718    ns/op
o.a.l.l.p.j.Log4jLogEventBenchmark.testNoException   sample     52827      
119.124        3.847    ns/op
{code}

Throughput:
{code}
Benchmark                                              Mode   Samples         
Mean   Mean error    Units
o.a.l.l.p.j.Log4jLogEventBenchmark.testBaseline       thrpt         5  
2181458.695   253325.442   ops/ms
o.a.l.l.p.j.Log4jLogEventBenchmark.testException      thrpt         5    
10332.363      661.657   ops/ms
o.a.l.l.p.j.Log4jLogEventBenchmark.testNoException    thrpt         5    
10205.462      672.303   ops/ms
{code}


> (TBD) Refactor Log4jLogEvent to lazily create ThrowableProxy
> ------------------------------------------------------------
>
>                 Key: LOG4J2-250
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-250
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 2.0-beta5
>            Reporter: Remko Popma
>            Assignee: Remko Popma
>             Fix For: 2.0-rc2
>
>
> Background: during investigation of LOG4J2-245, several people raised 
> performance concerns regarding ThrowableProxy. This issue is to separate that 
> concern so that LOG4J2-245 can focus on resolving the EmptyStackException.
> ThrowableProxy does quite a bit of expensive-looking work to find the JAR 
> file or directory where the class that threw the exception is located. This 
> work is done for every event that contains an exception.
> However, this information is only used when the configuration contains either 
> a RootThrowablePattern {"rEx", "rThrowable", "rException" } or an 
> ExtendedThrowablePattern {"xEx", "xThrowable", "xException" } or when the 
> LogEvent is serialized.
> I propose to change the Log4jLogEvent implementation: instead of 
> unconditionally creating a ThrowableProxy object every time a log event 
> contains an exception, only wrap this exception in a ThrowableProxy when 
> either:
> * the {{getThrownProxy()}} method is called
> * the log event is serialized
> For reference, similar work has already been done on 
> {{o.a.l.l.core.async.RingBufferLogEvent}}.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to