You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Milan Tomic <mi...@setcce.org> on 2004/12/18 12:02:54 UTC

MemBufFormatTarget (initial buffer value)

	What will happen if I specify for inital value less than I need,
or I don't specify inital value at all? How will it affect performance?
Is it better to specify more than you need or it is better to let
MemBufFormatTarger class resize buffer?

Thank you very much,
Milan

Re: MemBufFormatTarget (initial buffer value)

Posted by Alberto Massari <am...@progress.com>.
At 12.02 18/12/2004 +0100, Milan Tomic wrote:

>         What will happen if I specify for inital value less than I need, 
> or I don't specify inital value at all? How will it affect performance? 
> Is it better to specify more than you need or it is better to let 
> MemBufFormatTarger class resize buffer?

Hi Milan,
if you don't specify a value, 1023 will be used. Every time the buffer will 
need to be expanded, it will be resized to be the double of the current size.
So it is best to specify more than you need (so that there is only one 
allocation), if you know this value; in any case the class will try to make 
as few allocations as possible.

Alberto

>Thank you very much,
>Milan



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org