Re: [xml] libxml2 performance



On Wed, May 29, 2002 at 10:35:13AM +0200, Peter Jacobi wrote:
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.
[...]
So, for this example heap management plus xmlStrnDup
takes 40% of execution time.

  here using gprof:

xmllint --noout --timing --repeat doc/libxml2-api.xml

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total
 time   seconds   seconds    calls  us/call  us/call  name   
 22.65      0.94     0.94  1167400     0.81     1.39  xmlParseAttValue
  7.71      1.26     0.32 18745300     0.02     0.02  xmlCurrentChar
  7.71      1.58     0.32    12400    25.81    25.81  isolat1ToUTF8
  5.78      1.82     0.24  3570200     0.07     0.07  xmlNextChar
  4.58      2.01     0.19  1167500     0.16     0.20  xmlFreeNodeList
  4.34      2.19     0.18   917400     0.20     0.44  xmlParseCharData
  3.86      2.35     0.16  5782622     0.03     0.03  xmlStrndup
  3.37      2.49     0.14  1167400     0.12     0.53  attribute
  2.89      2.61     0.12  1167400     0.10     0.10  xmlNewNsPropEatName
  2.89      2.73     0.12   675000     0.18     1.54  startElement
  2.65      2.84     0.11  1842400     0.06     0.09  xmlSplitQName
  2.65      2.95     0.11  1167400     0.09     0.19  xmlStringGetNodeList
  2.65      3.06     0.11   675000     0.16     4.69  xmlParseStartTag
  2.41      3.16     0.10   675000     0.15     0.19  xmlNewDocNodeEatName
  2.17      3.25     0.09  2058700     0.04     0.07  xmlNewTextLen
  2.17      3.34     0.09  1875400     0.05     0.08  xmlParseName
  1.45      3.40     0.06  3824300     0.02     0.02  xmlSkipBlankChars
  1.45      3.46     0.06  1566300     0.04     0.06  xmlAddChild
  1.45      3.52     0.06  1349900     0.04     0.04  xmlSearchNs
  1.20      3.57     0.05   945300     0.05     0.18  characters
  1.20      3.62     0.05   675000     0.07     4.91  xmlParseElement

  Complex document encoded in ISO Latin 1, the attributes processing
and work related to the conversion takes the lead

xmllint --noout --timing --repeat ~/XSLT/tests/XSLTMark/db1000.xml

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total
 time   seconds   seconds    calls  us/call  us/call  name
 18.67      0.28     0.28  1600100     0.17     0.36  xmlParseCharData
  7.33      0.39     0.11      100  1100.00  1100.00  xmlFreeNodeList
  6.67      0.49     0.10  3200822     0.03     0.03  xmlStrndup
  6.67      0.59     0.10   800100     0.12     0.96  xmlParseContent
  6.00      0.68     0.09  3651400     0.02     0.02  xmlParserInputShrink
  4.67      0.75     0.07   800100     0.09     0.34  startElement
  4.00      0.81     0.06  3651400     0.02     0.04  xmlSHRINK
  4.00      0.87     0.06  2400200     0.02     0.04  xmlAddChild
  4.00      0.93     0.06  1600100     0.04     0.07  xmlNewTextLen
  4.00      0.99     0.06   800100     0.07     0.75  xmlParseElement
  4.00      1.05     0.06   800100     0.07     0.22  xmlParseEndTag
  4.00      1.11     0.06   800100     0.07     0.07  xmlParseNameAndCompare
  3.33      1.16     0.05  1600100     0.03     0.03  xmlSearchNs
  3.33      1.21     0.05   800100     0.06     0.09  xmlSplitQName
  2.67      1.25     0.04  1600600     0.02     0.02  xmlSkipBlankChars
  2.67      1.29     0.04  1600100     0.02     0.14  characters
  2.00      1.32     0.03  1600100     0.02     0.02  xmlSetTreeDoc
  2.00      1.35     0.03   800100     0.04     0.07  xmlParseName
  1.33      1.37     0.02   800100     0.02     0.02  nodePop
  1.33      1.39     0.02   800100     0.02     0.02  nodePush
  1.33      1.41     0.02   800100     0.02     0.04  xmlNewDocNodeEatName

  Simple regular document without attributes and already UTF8, the 
main time consuming task are the acquisition loops and allocation routines.

  In a nutshell, the default parsing paths are optimized, but there is still
1/ too many allocations 2/ attributes handling is too expensive, at least from
my platform perspective.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.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]