[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



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