Re: [xml] too many mallocs?

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).

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).

Peter Jacobi

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