Return-Path: X-Original-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8EFF410938 for ; Tue, 24 Mar 2015 04:29:53 +0000 (UTC) Received: (qmail 57772 invoked by uid 500); 24 Mar 2015 04:29:53 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 57721 invoked by uid 500); 24 Mar 2015 04:29:53 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-issues@hadoop.apache.org Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 57705 invoked by uid 99); 24 Mar 2015 04:29:53 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Mar 2015 04:29:53 +0000 Date: Tue, 24 Mar 2015 04:29:53 +0000 (UTC) From: "Andrew Wang (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-7978) Add LOG.isDebugEnabled() guard for some LOG.debug(..) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HDFS-7978?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14377256#comment-14377256 ] Andrew Wang commented on HDFS-7978: ----------------------------------- Hey Walter, I'd prefer if we worked on switching over to slf4j in most of these cases, rather than adding if guards. That saves the string construction cost. I don't think any of the functions you wrapped in this patch are particularly expensive, but if you disagree we can keep the if guards. > 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)