Antoine Levy-Lambert wrote:
Matt Benson wrote:
Kev: I've asked some stuff about FileUtils before...
historically it was thought it might be pluggable,
hence all the instance methods. But that never
happened so the static methods crept in. I think it
was Martijn who really pushed in the FileUtils
singleton. Most places in Ant's code don't
instantiate their own FileUtils anymore, and if they
do they shouldn't; they should use the singleton.
-Matt
Hello Kev,
if you want to do some optimization work for copy,
can you have a look at this bug report :
http://issues.apache.org/bugzilla/show_bug.cgi?id=30094
Using nio for copy operations to network drives under Windows brings a
huge performance improvement.
I used it on Windows 2000 or 2003 and JDK 1.4, with as target some
drives automounted from a NAS box.
With NIO the copy speed is at least 4 times as big.
Last time I used NIO was just when 1.4 came out, and while the speed was
impressive (over 1.3), the memory usage was very large (for file mapped
stuff). At the time I was processing large files, so I didn't get to
play with it as it made our server (Sun something) cry :(.
I've knocked up a quick implementation of what is suggested in the bug
report (and Steve L's suggested strategy, at least my understanding of
said strategy). Now I have a FileUtilsAdapterFactory, a
FileUtilsAdapter and 3 implementations FileUtils - for bwc, NioFileUtils
and Java6FileUtils. So far all is well - indeed during bootstrap, Ant
handily picks up the new NioFileUtils to perform it's copies - yay!
I'll post full code for comments/review later, but to implement this
across the whole code base will take a while - I'm not sure everyone
will think it's worthwhile.
Kev
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]