Hi Tom,

> whoever is responsible currently for XCOPY (Blair?):

Good question!

>    if (chsize(fddest,filelength(fdsrc)) == -1)
>       ...
> 
> Borland RTL fills the file with '\0', using a small buffer, and is
> sloooooooooow.
> 
> use
> 
>         filesize = filelength(fdsrc);
>         
>         lseek(fddest, filesize, SEEK_SET);
>         dosreadwrite(fddest, NULL,0, 1);                        // writing 0 
> bytes extends or truncates file
>         
>         
>         if (lseek(fddest, 0, SEEK_CUR) != filesize)
>            ...
> 
> 
> instead for a total speed gain of ~3x

Very good point! Immediately bringing the file to the final number
of clusters in the FAT probably already gives a speed gain itself,
while pre-filling the whole file with 0 bytes is plain masochistic.

I wonder which of the two is the reason for how much of the slowness.

A possible test could be to grow the file as part of the actual copy,
instead of pre-growing it in that chsize call: That test case would
still have the slow incremental instead of one-jump FAT growth, but
it would avoid the extra waste due to pre-wiping with zeroes.

May also give interesting benchmark differences for different DOSes.

Cheers, Eric



------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Freedos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to