[fpc-pascal] File handling: the TFileStream or the classical way is faster and more efficient?

Michael Van Canneyt michael at freepascal.org
Wed May 27 09:56:49 CEST 2015



On Wed, 27 May 2015, Michael Schnell wrote:

> On 05/26/2015 06:25 PM, J├╝rgen Hestermann wrote:
>> 
>> If you copy thousands of files with only a few bytes each
>> then it may become very noticable, what "else" is done
>> (in additon to the pure OS copy of the files).
>> 
> I don't think so. Opening the file is a tedious task for the OS. So I suppose 
> the User-program/OS relation is not that different regarding the file size.

Of course it is. 
If you write to a file of 1Gb in blocks of 256 bytes, or you write to a 1Gb file in blocks of 1Mb, 
you will surely see the difference. A kernel call always introduces overhead.

Michael.


More information about the fpc-pascal mailing list