Re: [xml] libxml2 performance



HI Gary, All,

Gary Pennington wrote (in response to Bjorn Reese:

I'm inclined to agree with you, although it should be noted that the
performance of memory allocators is going to vary significantly across
platforms. The Solaris allocator is reasonably efficient. 

Happy you.

I finally managed to get the somewhat awkward Watcom profiler to
work and profiled 
xmllint --noout --timing --repeat api-e.xml
on the slowest system at hand (remember, I mainly want to 
help the slow ones at the moment), PPro 200MHz running WinNT4.

api-e.xml is libxml-api.xml with all attributes converted to elements
using the XSLT found at 
http://safari.oreilly.com/main.asp?bookname=xslt&snode=160
(with all the smart guys in XML-DEV bashing on attribute use for
data, who wants to stand back...)

This machine needed 500ms per iteration and gives this
list of functions taking more than 0.5% (all numbers are percentages):

library
        19.2    malloc
        12.6    free
         4.4    stosd
         1.0    memset
         1.0    fread
      
sax
         1.4    characters
         1.1    endElement
         1.1    startElement
         
parser
         6.4    xmlParseCharData
         5.2    xmlParseContent
         3.5    xmlStrndup
         2.5    xmlParseStartTag
         2.5    xmlParseEmdTag
         1.7    xmlParseElement
         1.6    xmlParseName
         1.4    xmlSkipBlankChars
         0.8    xmlParseNameAndCompare
         0.7    namePop
         0.7    namePush
         0.7    nodePush
         
parserinternals
         1.9    xmlParserInputShrink

tree        
         6.1    xmlFreeNodeList
         5.2    xmlSearchNs
         2.5    xmlAddChild
         0.7    xmlNewNodeEatName
         0.7    xmlSetTreeDoc


So, for this example heap management plus xmlStrnDup
takes 40% of execution time.

Regards,
Peter Jacobi





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