JeffBlodgett/FileSieve — pull request #26 by JeffBlodgett (2014-08-08 18:05:09+00:00)
Title: Concurrent file copying

Modifications have been made to enable any number of files to be concurrently copied. Project is compiling, testing, and running well but I'm giving these changes a couple days to simmer. With my test files (1.5 GB total, 3 of the 184 files of which are very large MOV files and compose 79 percent of the total size), this new version takes 24 seconds compared to the 1 minute 21 seconds to complete the copy job (3.4x improvement in speed for this file set).

SwingCopyJob is currently fixed at 10 file-copy threads but I will add methods to it and FileManager to enable the number of concurrent file-copy threads to be set at job creation or dynamically changed after the job has begun.

The original SwingCopyJob's background worker thread now only handles publishing of progress updates on the EDT. It delegates copy operations to a Runnable that is started on a separate thread. That Runnable oversees folder creation in the destination folder and oversees a ThreadPoolExecutor (pool of threads) into which FileCopy tasks are passed (a second Runnable type).

Next major step, after merging of this request, will be to investigate the use of multiple threads per file copy. It isn't immediately obvious to me how this benefits the overall process. Perhaps there are advantages to be seen with burst speeds where network connections are involved. I'll need to go back and run some RichCopy tests first.