You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (JIRA)" <ji...@apache.org> on 2014/06/12 00:51:07 UTC

[jira] [Commented] (PDFBOX-2131) Avoid constructing debug messages if debug log is off

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

Tilman Hausherr commented on PDFBOX-2131:
-----------------------------------------

+1

However I believe that the first debug log statement in the patch will never be called because it is after the return.

> Avoid constructing debug messages if debug log is off
> -----------------------------------------------------
>
>                 Key: PDFBOX-2131
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2131
>             Project: PDFBox
>          Issue Type: Improvement
>    Affects Versions: 2.0.0
>            Reporter: Petr Slaby
>            Priority: Trivial
>         Attachments: DebugLog.patch
>
>
> Concatenation and formatting of strings takes some time. If a debug message is written to the log at a frequently called place, it should be surrounded by an if(LOG.isDebugEnabled()). Using the if everywhere does not do any harm either.
> Attached patch changes two classes which were sticking out in the profiler. The difference in performance is not that big, but, in my application, each millisecond counts.



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