RE: [xml] libXml speed and memory use (v Xerces)



Benchmarking is a notoriously difficult thing to do well; so much depends on
the particulars.  Your benchmark may be a better or worse reflection of your
actual use case(s) than the one on SourceForge.

Bear in mind that the benchmark is a bit dated.  It compares Xerces 2.1 and
libxml2 2.4.30; current versions are 2.3 and 2.5.8 respectively.  The Xerces
crew has done a fair amount of performance tuning since 2.1, especially in
2.2.

-----Original Message-----
From: Vincent Finn [mailto:vincent finn automsoft com] 
Sent: Friday, July 18, 2003 12:49 PM
To: 'xml gnome org'
Subject: [xml] libXml speed and memory use (v Xerces)


Hi,

On the web page for libXml there are time comparisons given 
between it and
xerces
and lib comes out ahead

I am comparing it to xerces (not in a very sophisticated way) 
and getting
very different results

I'll put my code and results at the bottom but basically xerces uses
substantially less memory
and is noticeably quicker

Are there any optimisations in building of libXml2.dll that 
can be switched
on and off for performance?

since I might have expected one or the other to be worse but 
not both !!
      
      Vin

Here is the code I used

libXml
------
      int iStartTime = time(NULL);
      int const c_iIterations = (int)1e4;
      for (int i = 0; i < c_iIterations; ++i)
      {
              xmlDocPtr test = xmlParseFile(strFileName.c_str());
              xmlFreeDoc(test);
      }
      int iEndTime = time(NULL) - iStartTime;

results 
      Memory use 2,154,496 bytes
      time taken 120 seconds

--------------------------------------------------

xerces
------
      XMLPlatformUtils::Initialize();
      int iStartTime = time(NULL);
      int const c_iIterations = (int)1e4;
      for (int i = 0; i < c_iIterations; ++i)
      {
              XercesDOMParser test;
              test.parse(strFileName.c_str());
              DOMDocument* doc = test.getDocument();
      }
      int iEndTime = time(NULL) - iStartTime;
      XMLPlatformUtils::Terminate();
results
      Memory use 1,851,393 bytes
      time taken 95 seconds
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xml gnome org
http://mail.gnome.org/mailman/listinfo/xml




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