Re: [xml] too many mallocs?

On Thu, May 23, 2002 at 06:30:17PM +0200, Peter Jacobi wrote:
Daniel, All,

And there are 37 mallocs of size 3944 in case 1, compared with
62 mallocs of size 3900 in case 2, most likely from xmlInputBufferGrow.

  I think Garry Pennington looked at this recently.

I now think I know what's causing this, but I don't have a clean patch yet.

Once we are within INPUT_CHUNK near the end of file, 
xmlParserInputGrow and xmlParserInputBufferGrow will
be called from every GROW (and always report they can
read zero bytes).

  is that with the CVS version ?

For a test I appended 2*INPUT_CHUNK of '\0' to the input buffer
in xmlParserInputGrow once xmlParserInputBufferGrow
returns zero. This eliminates further calls and mallocs,
but I assume it will break quite a lot (when more than
one entity is parsed).

  Okay, there is some cleanup to be done then <grin/>


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]