Bug 124209 - Implement file copy with FileChannel#transferTo
Summary: Implement file copy with FileChannel#transferTo
Status: RESOLVED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: John Arthorne CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-17 16:57 EST by John Arthorne CLA
Modified: 2006-05-03 11:23 EDT (History)
0 users

See Also:


Attachments
patch to use nio channel copy (5.53 KB, text/plain)
2006-01-17 16:57 EST, John Arthorne CLA
no flags Details
Latest Channel copy patch (5.53 KB, patch)
2006-01-24 10:16 EST, John Arthorne CLA
no flags Details | Diff
Latest Channel copy patch (8.56 KB, patch)
2006-01-24 10:19 EST, John Arthorne CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2006-01-17 16:57:03 EST
See if using FileChannel#transferTo makes LocalFile#copy any faster
Comment 1 John Arthorne CLA 2006-01-17 16:57:28 EST
Created attachment 33174 [details]
patch to use nio channel copy
Comment 2 John Arthorne CLA 2006-01-19 11:16:47 EST
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).
Comment 3 John Arthorne CLA 2006-01-24 10:16:25 EST
Created attachment 33512 [details]
Latest Channel copy patch
Comment 4 John Arthorne CLA 2006-01-24 10:19:01 EST
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.
Comment 5 John Arthorne CLA 2006-01-24 11:12:49 EST
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.
Comment 6 John Arthorne CLA 2006-01-24 11:25:27 EST
I have released the latest patch.
Comment 7 John Arthorne CLA 2006-05-03 11:23:31 EDT
Reopening - this change was reverted due to test failures.
Comment 8 John Arthorne CLA 2006-05-03 11:23:43 EDT
Closing.