Return-Path: X-Original-To: apmail-logging-log4j-dev-archive@www.apache.org Delivered-To: apmail-logging-log4j-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 010F518028 for ; Fri, 21 Aug 2015 19:33:46 +0000 (UTC) Received: (qmail 11076 invoked by uid 500); 21 Aug 2015 19:33:45 -0000 Delivered-To: apmail-logging-log4j-dev-archive@logging.apache.org Received: (qmail 11026 invoked by uid 500); 21 Aug 2015 19:33:45 -0000 Mailing-List: contact log4j-dev-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Log4J Developers List" Reply-To: "Log4J Developers List" Delivered-To: mailing list log4j-dev@logging.apache.org Received: (qmail 11017 invoked by uid 99); 21 Aug 2015 19:33:45 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Aug 2015 19:33:45 +0000 Date: Fri, 21 Aug 2015 19:33:45 +0000 (UTC) From: "Remko Popma (JIRA)" To: log4j-dev@logging.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Assigned] (LOG4J2-1097) [Perf] Custom TimeFormat MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LOG4J2-1097?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:all-tabpanel ] Remko Popma reassigned LOG4J2-1097: ----------------------------------- Assignee: Remko Popma > [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 > Assignee: Remko Popma > Fix For: 2.4 > > > In addition to the work done for LOG4J2-812 (replace synchronized SimpleD= ateFormat with commons FastDateFormat) I see a way to improve performance f= or the timestamp even further. > Ralph posted some very nice JMH benchmark results in LOG4J2-812, where th= e combination of caching, FastDateFormat and an AtomicReference was the win= ner. > I believe this is the way to go, but we may be able to do even better. Fo= r some common date formats, it is possible to get a 5X speedup versus FastD= ateFormat.=20 > 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 ISO86= 01. 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 =C2=B1 0.842 ns/op > o.a.l.l.p.j.TimeFormatBenchmark.customBitFiddlingFormatString sample = 157268 87.616 =C2=B1 1.557 ns/op > o.a.l.l.p.j.TimeFormatBenchmark.customFormatString sample = 170168 82.650 =C2=B1 1.326 ns/op > o.a.l.l.p.j.TimeFormatBenchmark.customFormatStringBuilder sample = 108884 67.825 =C2=B1 1.577 ns/op > o.a.l.l.p.j.TimeFormatBenchmark.fastDateFormatString sample = 148478 317.145 =C2=B1 1.850 ns/op > o.a.l.l.p.j.TimeFormatBenchmark.simpleDateFormatString sample = 173226 263.886 =C2=B1 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