You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Nick Chadwick (JIRA)" <ji...@apache.org> on 2016/06/01 15:26:59 UTC
[jira] [Comment Edited] (LOG4J2-1403) Unboxer in new gc-free
implementation
[ https://issues.apache.org/jira/browse/LOG4J2-1403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15310411#comment-15310411 ]
Nick Chadwick edited comment on LOG4J2-1403 at 6/1/16 3:26 PM:
---------------------------------------------------------------
On further testing, I have some concerns around performance now. I have a fairly simple service which receives requests and sends responses, during which a message is logged (with 4 primitive arguments, using the Unboxer). Prior to using the GC-free functionality in 2.6, 1 million messages were handled in ~3 seconds. Now, it takes ~7 seconds, with approximately 90% of the processing time being used up by logging...I wonder how relevant the ResponseTimeTest is, given that it is logging blank messages?
Update: it doesn't seem to be anything to do with using Unbox.box(); if I just change it to log a plain string message, it still takes just as long. Will continue to investigate.
was (Author: nick.chadwick@nichesolutions.co.uk):
On further testing, I have some concerns around performance now. I have a fairly simple service which receives requests and sends responses, during which a message is logged (with 4 primitive arguments, using the Unboxer). Prior to using the GC-free functionality in 2.6, 1 million messages were handled in ~3 seconds. Now, it takes ~7 seconds, with approximately 90% of the processing time being used up by logging...I wonder how relevant the ResponseTimeTest is, given that it is logging blank messages?
> Unboxer in new gc-free implementation
> -------------------------------------
>
> Key: LOG4J2-1403
> URL: https://issues.apache.org/jira/browse/LOG4J2-1403
> Project: Log4j 2
> Issue Type: Question
> Components: API
> Affects Versions: 2.6
> Reporter: Nick Chadwick
> Priority: Minor
>
> Firstly, thanks for the GC-free work you've done in 2.6 - it's great news, and I've already adopted it in the project I'm currently involved with.
> However, I just wanted to point out a possible wrinkle, for discussion as much as anything. As a matter of habit, I try to surround any low-level (e.g. debug, trace) log statement that does any processing in its parameters (i.e. calls methods, etc) with a check to .isXXXEnabled(). This means that the enabled check will run twice - once when I call it explicitly, and once under the hood when the log statement runs.
> With the new GC-free stuff, wrapping primitives using Unbox.box() meets this criteria - I don't really want a log statement for a disabled level using up processing power appending to StringBuilders for all the primitive arguments to the log statement, when I'm not going to use the results. Therefore, everywhere I have these low-level log statements that are using Unbox.box(), I have to wrap them in enabled checks.
> Concerned that this may have an impact on performance, I am instead caching the result of .isXXXEnabled() in a static variable on the class.
> I'm just wondering whether this has been considered, and if this is the right approach?
> Thanks
--
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