logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Remko Popma (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOG4J2-1097) [Perf] Custom TimeFormat
Date Fri, 21 Aug 2015 03:28:45 GMT

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

Remko Popma commented on LOG4J2-1097:
-------------------------------------

I committed an initial version of CustomDateFormat to master so others can look at it and
to allow me to work on unit tests etc in other locations. Feedback welcome.

> [Perf] Custom TimeFormat
> ------------------------
>
>                 Key: LOG4J2-1097
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1097
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: Layouts, Pattern Converters
>    Affects Versions: 2.3
>            Reporter: Remko Popma
>             Fix For: 2.4
>
>
> In addition to the work done for LOG4J2-812 (replace synchronized SimpleDateFormat with
commons FastDateFormat) I see a way to improve performance for the timestamp even further.
> Ralph posted some very nice JMH benchmark results in LOG4J2-812, where the combination
of caching, FastDateFormat and an AtomicReference was the winner.
> I believe this is the way to go, but we may be able to do even better. For some common
date formats, it is possible to get a 5X speedup versus FastDateFormat. 
> This is not as generic as FastDateFormat; at the moment it only supports {{HH:mm:ss,SSS}}.
I would like to support the "common" DatePatternConverter formats ABSOLUTE, COMPACT, DATE_AND_TIME,
DEFAULT, ISO8601_BASIC and ISO8601. For any other date format pattern we fall back to FastDateFormat.
> Performance results are below (benchmark is in git master):
> {noformat}
> Benchmark                                                          Mode  Samples    Score
   Error  Units
> o.a.l.l.p.j.TimeFormatBenchmark.baseline                         sample   118021   18.783
±  0.842  ns/op
> o.a.l.l.p.j.TimeFormatBenchmark.customBitFiddlingFormatString    sample   157268   87.616
±  1.557  ns/op
> o.a.l.l.p.j.TimeFormatBenchmark.customFormatString               sample   170168   82.650
±  1.326  ns/op
> o.a.l.l.p.j.TimeFormatBenchmark.customFormatStringBuilder        sample   108884   67.825
±  1.577  ns/op
> o.a.l.l.p.j.TimeFormatBenchmark.fastDateFormatString             sample   148478  317.145
±  1.850  ns/op
> o.a.l.l.p.j.TimeFormatBenchmark.simpleDateFormatString           sample   173226  263.886
± 10.615  ns/op{noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message