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



On Tue, Jul 13, 2004 at 04:14:34PM +0100, Steve Hay wrote:
Could somebody please try this on Linux (well, anything other than Win32 
I guess) and tell me how long it takes to run?

On my P4 2GHz Win32 box it takes 15seconds -- exactly the same time as 
the XML parsing/dumping earlier!  (And it's just as slow without the 
printf() calls in it.)

I dare say the time will be 0 or 1 second on Linux.

paphio:~/XML -> time ./tst > /dev/null
 
real    0m0.003s
user    0m0.000s
sys     0m0.000s
paphio:~/XML ->

 I think 0 is appropriate... seems it between 3 and 4 orders of magnitude
faster on Linux, nice job from Redmond :-)

My soul is indeed lost :(  Where do I go from here?  (Don't say Linux...)

  We need to make sure the buffer which is expanded in 16000 increment
is instead using a doubling allocation scheme like the one used for
reading it, that should solve it. One solution is to change the Grow
operation to always double (at least) if buf-alloc is XML_BUFFER_ALLOC_DOUBLEIT
in xmlBufferGrow(). Could be a 3 line patch, possibly conditionalized
with #ifdef WIN32 /* Windows realloc() is really bad */ #else #endif

  Might be slight simpler than switching OS (though the later might be
the right solution in the long term)...

Daniel

-- 
Daniel Veillard      | Red Hat Desktop team http://redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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