[
https://issues.apache.org/jira/browse/HDFS-7978?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14377369#comment-14377369
]
Walter Su commented on HDFS-7978:
---------------------------------
I skipped all:
1. pure "string1" + "string2". ( Because compiler will optimize it)
2. "string1" + obj1 ( only if obj1 is String type, because it's inexpensive)
3. debug("string", obj1, obj2)
4. debug(obj1)
I only wrap these:
1. "string1" + obj1 + "string2" ( concatenating object and String more than 4~5
times)
> 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)