[fpc-pascal] IBConnection blobsegmentsize irrelevant & performance

Michael Van Canneyt michael at freepascal.org
Sat Nov 19 23:31:00 CET 2011



On Sat, 19 Nov 2011, Reinier Olislagers wrote:

> Hi list,
>
> The Firebird/Interbase ibconnection.pp code has this code in its
> SetParameters procedure to upload blobs in segments (BlobSegmentSize
> property is set to 80 on object creation):
>      while BlobBytesWritten < (BlobSize-BlobSegmentSize) do
>        begin
>        isc_put_segment(@FStatus[0], @blobHandle, BlobSegmentSize,
> @s[(i*BlobSegmentSize)+1]);
>        inc(BlobBytesWritten,BlobSegmentSize);
>        inc(i);
>        end;
>      if BlobBytesWritten <> BlobSize then
>        isc_put_segment(@FStatus[0], @blobHandle,
> BlobSize-BlobBytesWritten, @s[(i*BlobSegmentSize)+1]);
>
> I've asked the Firebird list whether we need to upload in segments and
> the answer is no, you can upload in chunks of up to 65535 bytes (see below).
>
> Would getting rid of the BlobSegmentSize property and replacing it by a
> BlobSegmentSize const set at 65535 make sense (e.g. for performance)?

Well, if Ann Harrison herself says it's irrelevant, then yes. 
I suspect it would indeed give a serious performance boost :)

Michael.



More information about the fpc-pascal mailing list