commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aaron Ehrensberger" <aehrensber...@docfinity.com>
Subject Directory Walker speed
Date Tue, 26 May 2009 13:28:27 GMT
Hi,

 

I've done some testing with the DirectoryWalker API and found some
curious results and am wondering if someone else could confirm my
suspicions.

 

I have two scenarios, working with 5000 files....

 

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

 

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

 

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.

 

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?

 

Thanks,

Aaron

 

 

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

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message