[
https://issues.apache.org/jira/browse/LOG4J2-744?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Scott Harrington updated LOG4J2-744:
------------------------------------
Attachment: ClockBenchmark-jdk1.6.0_31.txt
Summary of results for Java 6 (full results attached). Similar numbers as Java
7.
{noformat}
Benchmark
Mode Samples Mean Mean error Units
o.a.l.l.p.j.ClockBenchmark.testBaseline
sample 236376 28.708 0.068 ns/op
o.a.l.l.p.j.ClockBenchmark.testCachedClockSimpleMessage
sample 194881 480.207 2.354 ns/op
o.a.l.l.p.j.ClockBenchmark.testCachedClockSimpleMessageNoDowncast
sample 260867 185.352 0.479 ns/op
o.a.l.l.p.j.ClockBenchmark.testCachedClockTimestampMessage
sample 277257 64.729 0.221 ns/op
o.a.l.l.p.j.ClockBenchmark.testCoarseCachedClockSimpleMessage
sample 383724 83.279 0.191 ns/op
o.a.l.l.p.j.ClockBenchmark.testCoarseCachedClockSimpleMessageNoDowncast
sample 379254 82.977 0.169 ns/op
o.a.l.l.p.j.ClockBenchmark.testCoarseCachedClockTimestampMessage
sample 273283 66.129 0.151 ns/op
o.a.l.l.p.j.ClockBenchmark.testFakeClockSimpleMessage
sample 274039 104.556 0.279 ns/op
o.a.l.l.p.j.ClockBenchmark.testFakeClockSimpleMessageNoDowncast
sample 363139 88.456 4.470 ns/op
o.a.l.l.p.j.ClockBenchmark.testFakeClockTimestampMessage
sample 274962 65.897 0.214 ns/op
o.a.l.l.p.j.ClockBenchmark.testOrdinaryLogEvent
sample 206789 132.297 0.643 ns/op
o.a.l.l.p.j.ClockBenchmark.testSystemClockSimpleMessage
sample 201981 136.891 9.946 ns/op
o.a.l.l.p.j.ClockBenchmark.testSystemClockSimpleMessageNoDowncast
sample 231942 120.551 0.367 ns/op
o.a.l.l.p.j.ClockBenchmark.testSystemClockTimestampMessage
sample 267079 66.281 0.206 ns/op
{noformat}
> Avoid unnecessary Clock calls when TimestampMessage is logged
> -------------------------------------------------------------
>
> Key: LOG4J2-744
> URL: https://issues.apache.org/jira/browse/LOG4J2-744
> Project: Log4j 2
> Issue Type: Improvement
> Reporter: Scott Harrington
> Priority: Minor
> Attachments: ClockBenchmark-jdk1.6.0_31.txt,
> ClockBenchmark-jdk1.7.0_45.txt, ClockBenchmark.java, LOG4J2-744-test.patch,
> LOG4J2-744.patch
>
>
> The TimestampMessage interface was introduced in LOG4J2-53 and revised for
> AsyncLogger in LOG4J2-455.
> I've observed that Clock.currentTimeMillis is still called which should not
> be necessary.
> I have two patches, one which adds JUnit tests that demonstrate the
> unnecessary Clock calls, and one which fixes the issue for both AsyncLogger
> and "traditional" configurations.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]