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 D87E37ECC for ; Wed, 20 Jul 2011 19:03:37 +0000 (UTC) Received: (qmail 90917 invoked by uid 500); 20 Jul 2011 19:03:33 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 90512 invoked by uid 500); 20 Jul 2011 19:03:30 -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 88749 invoked by uid 99); 20 Jul 2011 19:03:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Jul 2011 19:03:19 +0000 X-ASF-Spam-Status: No, hits=-2001.1 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Jul 2011 19:03:18 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 39DDD4B681 for ; Wed, 20 Jul 2011 19:02:58 +0000 (UTC) Date: Wed, 20 Jul 2011 19:02:58 +0000 (UTC) From: "Uma Maheswara Rao G (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: <1860393450.8826.1311188578233.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <188084893.3950.1300809545790.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (HDFS-1774) Small optimization to FSDataset 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-1774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13068564#comment-13068564 ] Uma Maheswara Rao G commented on HDFS-1774: ------------------------------------------- Thanks a lot for Nicholas and Eli for Review :-) > Small optimization to FSDataset > ------------------------------- > > Key: HDFS-1774 > URL: https://issues.apache.org/jira/browse/HDFS-1774 > Project: Hadoop HDFS > Issue Type: Improvement > Components: data-node > Reporter: Uma Maheswara Rao G > Assignee: Uma Maheswara Rao G > Priority: Minor > Fix For: 0.23.0 > > Attachments: HDFS-1774-1.patch, HDFS-1774-1.patch, HDFS-1774.patch > > > Inner class FSDir constructor is doing duplicate iterations over the listed files in the passed directory. We can optimize this to single loop and also we can avoid isDirectory check which will perform some native invocations. > Consider a case: one directory has only one child directory and 10000 files. > 1) First loop will get the number of children directories. > 2) if (numChildren > 0) , This condition will satisfy and again it will iterate 10001 times and also will check isDirectory. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira