Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 9753 invoked from network); 26 May 2009 13:29:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 26 May 2009 13:29:17 -0000 Received: (qmail 81902 invoked by uid 500); 26 May 2009 13:29:28 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 81824 invoked by uid 500); 26 May 2009 13:29:28 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 81791 invoked by uid 99); 26 May 2009 13:29:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 May 2009 13:29:28 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [216.169.180.66] (HELO Exchange.OIT.DocFinity.com) (216.169.180.66) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 May 2009 13:29:18 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C9DE05.DA84700E" Subject: Directory Walker speed Date: Tue, 26 May 2009 09:28:27 -0400 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Directory Walker speed Thread-Index: AcneBdpfZYnb6JdpTIeyUnyAT/Vppg== From: "Aaron Ehrensberger" To: X-Virus-Checked: Checked by ClamAV on apache.org ------_=_NextPart_001_01C9DE05.DA84700E Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, =20 I've done some testing with the DirectoryWalker API and found some curious results and am wondering if someone else could confirm my suspicions. =20 I have two scenarios, working with 5000 files.... =20 Scenario 1 Multiple file types, stored relative to a high level directory, such that... c:\images\2009\05\26\03\filename\jpg c:\audio\2009\05\26\03\filename\audioFile c:\video\2009\05\26\03\filename\videoFile =20 Scenario 2 Mulitple file types, all stored as subdirectories of a certain date/time directory tree, such that... c:\2009\05\26\03\filename\images\jpg c:\2009\05\26\03\filename\audio\audioFile c:\2009\05\26\03\filename\video\videoFile =20 Now, the goal is to delete all images. I would have expected that simply blowing away the top level directory c:\images, which would then delete the entire directory and all the image files, would be the faster way to go. But, my timings have shown that using a DirectoryWalker to traverse all the directories in scenario 2 turns out to be quicker. My suspicion is because the amount of directory deletions is actually lower in the 2nd scenario, as we don't have to recursively delete all the subdirectories in order to get to the images directory. =20 I haven't been able to find any documentation yet to prove my suspicions though. Can anybody confirm that this is truly what is happening? =20 Thanks, Aaron =20 =20 Aaron Ehrensberger Software Architect DocFinity(r) by Optical Image Technology, Inc. 100 Oakwood Avenue, State College, PA 16803 ph: 814.238.0038 ext. 270 fax: 814.238.0011 email: aehrensberger@docfinity.com web: www.docfinity.com =20 ------_=_NextPart_001_01C9DE05.DA84700E--