Re: [xml] xmlDocDumpMemory() is VERY slow on Win32

On Tue, Jul 13, 2004 at 10:00:46AM +0100, Steve Hay wrote:

I am using VC6, but I don't have any profiling software available.  I'll 
try sticking some printf() calls in around the functions that you 
mentioned and see if I can find the bottleneck.

Profiler was a part of VC 6 last time I looked at it. Check whether the bin 
directory of your VC 6 installation contains files called profile.exe,
profile.dll and profiler.ini. 

Well, putting a printf() call at the start of xmlCharEncOutFunc() shows 
that it gets called hundreds of times over (all evenly spread) when 
there is an encoding declaration in the XML file, but not even once when 
there isn't.  (I tried both with and without iconv support enabled in 
the libxml2 build.)

It seems that out->encoder is NULL in xmlOutputBufferWrite() [xmlIO.c] 
when there is no encoding declaration.

Is that what was expected?

That is expected. That is why I think that precisely this function is the 

Your 10 MB CDATA section is being serialised in chunks of about 16000 bytes. 
That means that the function will be called aproximately 10M/16k times. The
calls are 'evenly spread', whatever you meay mean by it, because the
function is called in a loop.

Printfing the code won't give you smiles. You need a profiler. And with it,
in my role as a part-time prophet, I foretell: Your soul is lost. You will 
find the real reason for this in the Windows code, not in libxml. I really
have a bad, bad feeling about this matter.

I'll try to profile this later today.


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