Community
Participate
Working Groups
See if using FileChannel#transferTo makes LocalFile#copy any faster
Created attachment 33174 [details] patch to use nio channel copy
Results were disappointing. Using FileChannel#transferTo, it was about the same speed on Windows, and about 4% slower on Linux GTK (although the same benchmark was 20x faster on my dual 3GH Linux box to start with).
Created attachment 33512 [details] Latest Channel copy patch
Created attachment 33513 [details] Latest Channel copy patch Oops, I attached that before the patch wizard had finished, so it was the old patch again. This is the latest.
I have tested the following platform/VMs: Windows Sun 1.4.2 Windows IBM 1.4.2 Windows Sun 1.5.0_05 Linux Sun 1.4.2 Linux IBM 1.4.2 On all platforms except Linux IBM, the performance is the same within the margin of error, on Linux IBM it is 4% slower with a 2% margin of error. So, I am going to release this because the code is much cleaner and simpler, and future VM versions have much more potential to optimize FileChannel#transferTo than a simple FileInputStream/FileOutputStream copy using a buffer in the Java heap.
I have released the latest patch.
Reopening - this change was reverted due to test failures.
Closing.