XML::Twig is great if you need a pure Perl module, but XML::LibXML will produces results much quicker
XML::Twig is no more Pure Perl than XML::LibXML. Both use C libraries to perform the parsing. It's possible that XML::LibXML is faster, but it's not related to the choice of programming language.
XML::LibXML [...] isn't as memory heavy.
That's an odd thing to say. The whole idea of XML::Twig is to keep nothing in memory that doesn't need to be, whereas XML::LibXML keeps the whole document in memory.
| [reply] |
I stand corrected. It has been a while since I installed either, but XML::Twig is a bit easier to install than XML::LibXML.
I can't agree with your view on the memory aspect. While XML::Twig may to keep nothing in memory, it does get pretty leaky. Then again, It has been a while, and not the latest version.
Speed wise though LibXML is much faster than Twig. I had to switch our app from Twig to LibXML because documents in Twig were taking close to 5 seconds each, but LibXML was .05 seconds.
| [reply] |
Isn't that a classic trade-off? Pick one: fast or light weight. If you can use up as much memory as you want, finding something should not take a whole lot of time. But if you want to keep your RAM usage down, way down -- you have to spend extra CPU cycles to do so.
| [reply] |
XML::Twig is great if you need a pure Perl module, but XML::LibXML will produces results much quicker
XML::Twig is no more Pure Perl than XML::LibXML. Both use C libraries to perform the parsing. It's possible that's XML::LibXML is faster, but it's got nothing to do with language selection.
XML::LibXML [...] isn't as memory heavy.
The whole idea of XML::Twig is to keep nothing in memory that doesn't need to be, whereas XML::LibXML keeps the whole document in memory.
| [reply] |