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

Walter Su commented on HDFS-7978:
---------------------------------

I found out a lot debug("string", obj1, obj2..), and I didn't wrap them. I 
won't wrap isDebugEnabled() unless it's necessary. I only wrap what's written 
by concatenating, like "string" + obj1 + obj2 + "string"

> Add LOG.isDebugEnabled() guard for some LOG.debug(..)
> -----------------------------------------------------
>
>                 Key: HDFS-7978
>                 URL: https://issues.apache.org/jira/browse/HDFS-7978
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: Walter Su
>            Assignee: Walter Su
>         Attachments: HDFS-7978.001.patch
>
>
> {{isDebugEnabled()}} is optional. But when there are :
> 1. lots of concatenating Strings
> 2. complicated function calls
> in the arguments, {{LOG.debug(..)}} should be guarded with 
> {{LOG.isDebugEnabled()}} to avoid unnecessary arguments evaluation and impove 
> performance.



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

Reply via email to