in reply to Re: Perl_XML Twig Performance query
in thread Perl_XML Twig Performance query

I am not sure that libxml2 is much faster than expat, I think the difference in speed between XML::Parser based and XML::LibXML based modules is that XML::Parser converts all of the data to Perl data structures while XML::LibXML, at least in its DOM mode, leaves everything in C-land. So a module like XML::Twig needs to build and manage a tree in Perl, while XML::LibXML relies a lot more on the underlying C library, which unsurprisingly is faster and uses less memory.

But when you use XML::LibXML as the backend for XML::Simple, then you have to convert all the data into Perl, and you loose those benefits.

Replies are listed 'Best First'.
Re^3: Perl_XML Twig Performance query
by ikegami (Patriarch) on Apr 23, 2010 at 04:47 UTC

    I guess I wasn't clear. XML::LibXML was 12x faster than XML::Parser at creating exactly the same Perl data structure as XML::Parser. Nothing was left in "C-land".

Re^3: Perl_XML Twig Performance query
by ikegami (Patriarch) on Apr 23, 2010 at 04:49 UTC

    I guess I wasn't clear. XML::LibXML was 12x faster than XML::Parser at creating exactly the same Perl data structure as XML::Parser. Nothing was left in "C-land".