Strange performance behavior of IXMLDOMNode>>text in DPRO 5.1.4



Hello all,

I have come a quite a way in building my own framework to parse a particular XML file (that contains information about audio tracks). I can read and parse all the data, however the overall performance slows down dramatically with growing XML files. It takes about 3 minutes to parse an XML file with ca. 10560 tracks.

When using Ian's profiler, I found that 80% of that time was spent in the method IXMLDOMNode>>text. After some more experimentation I also found that the bigger the XML file was, the longer each method execution took, even if it was for the same node at the same position (close to the beginning of the file).

To test the latter I used the coding:

  root :=( IXMLDOMDocument new
               loadURL: 'file://P:\My Music\mp3testAll.xml')
                  documentElement.
  n := (root childNodes at: 2) firstChild firstChild.
  Time millisecondsToRun: [ 10000 timesRepeat: [ n text ] ]


and I changed the URL for the various files that I was testing with. My results (taken from the 3rd or 4th execution of the coding above for each URL) are:


  No. of tracks     File size [KB]    Execution time [s]
   in file
         1                  4               0.17
       500                614               0.38
      1000               1275               0.6
      5000               6598               9.6
     10559              14262              20.4

If anyone cares to reproduce this, I have uploaded the files I tested this with to http://www.geocities.com/bernhard_kohlhaas/xmltest.zip

I find this behavior very peculiar, because I would have expected the execution time to be more or less constant. Is this a Dolphin issue or a problem with Microsoft's implementation of DOM or something else completely?

Finally I loaded Steve Waring's Spray package and tried to parse this with the SAXHandler and the XMLDOMParser, but both choked on the file
'mp3test500.xml' with a walkback:


  SAXHandler parseDocumentFromFileNamed: 'mp3test500.xml'
  XMLDOMParser parseDocumentFromFileNamed: 'mp3test500.xml'

So it looks like I am stuck with the MS parser, thus I'd really like to get it to work faster.

I'd be very grateful for any suggestions on the matter,

Bernhard
.



Relevant Pages

  • RE: Bug in MSXML / XML Parser .Net
    ... > I have a problem parsing XML file using XSLT stylesheet by using: ... > System.Xml.XPath.MethodOperand.SetXsltContext(XsltContext context) ... > When I use XMLSpy to parse the XML using MSXML 4 processor it works perfect. ...
    (microsoft.public.dotnet.xml)
  • Re: How to get data from txt file into table of word template thro
    ... XLST file to transform the XML file into the output you need? ... I have a word document which has a lot of tables ... There's no way to answer the question about whether VBA is the best ... For the XML data source file, you said Word can parse it by itself. ...
    (microsoft.public.word.vba.general)
  • map and BYTE[]
    ... I need to parse a XML file that describes a smart card file structure ... CDataIndex(int nSFID, int nRecNo, int nOffset, int size) { ...
    (comp.lang.cpp)
  • xml parser
    ... I need to create a cgi program that will parse an xml file for ... xml file I am going to work with. ... My question is what would be the best (easiest/fastest) way to parse ...
    (perl.beginners)