what is the bottleneck when copying file from CD?

Florian von Walter fvwalter at web.de
Wed Jan 21 07:51:52 EST 2009


Tiemo,

first your chunk sizes are too big. The copying speed is largely
dependent from the sector size of the media you are copying from and to.
The standard DVD sector size is 512 bytes iirc. The sector size on the
disk of the computer you are copying to is dependent from the file
system being used and how it was initially set up. The standard sector
size for NTFS under Windows nowadays is 4096 bytes (4k) but it can vary
from 512 bytes to 16k. For FAT I don't know the sector sizes. For HFS(+)
under MacOS I also don't know it.
Second the copy speed for DVDs depends heavily on the DVD drive itself
(i.e. the firmware) and how the OS driver is implemented.
Third OS caching also comes into the picture.

I would recommend to try to use a chunk size of 4k maximum (also try
0.5k to see if this is faster).
Bigger chunk sizes don't make sense because they probably just replicate
data what is in the OS file system cache anyway (and therefore increase
the memory footprint of your application).
Everything else imo depends on factors you cannot influence.

Regards, Florian

Tiemo Hollmann TB wrote:
> Hello,
>
> I have to copy about 7 GB in 6 zip files from DVD-ROM to HD.
>
> I do it by a repeat loop with read - write - see below.
>
>  
>
> Because I experienced very big performance differences on different
> machines, I made extensive tests on different machines and different read
> chunk sizes in the repeat loop.
>
> First I experienced that the chunk size for reading has almost no influence
> on the total time. Tested with a chunkSize of 100K, 1MB, 10MB, 100MB.
>
> But I experienced very big differences on different machines. Total copying
> time for 6,7 GB varies between 27min on a PC Desktop (Core 2, 2,66Ghz, 2GB),
> 49 min On a Vista Notebook (Core 2 Duo, 1,86 Ghz, 2GB) and 93min on a
> MacBook (Core 2 Duo, 2,2 Ghz, 2GB), what meant a put through of 4,1 MB/s on
> the PC and 1,2 MB/s on the Mac.
>
>  
>
> I am not the hardware or system guy, so can anybody shed some light on these
> differences. What is the bottleneck and is there anything I can do in my
> script, or do I have to tell my customers "Installation time can vary
> between half an hour and two hours :-( ." and it is just like it is?
>
>  
>
> Thanks for any hint or experiences
>
> Tiemo
>
>  
>
>  
>
> The code snipped is:
>
>     open file tQuellFile for binary read
>
>     open file tZielFile for binary write
>
>     repeat until it is empty
>
>         read from file tQuellFile for gChunkSize #a global for testing
>
>         if it is not empty then
>
>             write it to file tZielFile
>
>         end if
>
>         add gChunkAdd to tMB
>
>         set the thumbpos of sb "Progress" to tMB
>
>         put tMB && "MB von gesamt ca." && gGesamtSize && "MB kopiert..."
> into fld "fldMB" # progress in MB
>
>         if the uCancel of this stack is true then
>
>             close file tQuellFile
>
>             close file tZielFile
>
>             answer "Abbruch"
>
>             exit to top
>
>         end if
>
>         wait 1 millisecs with messages # wait 0 didn't worked, no click on a
> button was accepted
>
>     end repeat
>
>  
>
>  
>
>  
>
>  
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>   



More information about the use-livecode mailing list