Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: Why oh why is working with XML so bloomin' difficult in Perl?

by ikegami (Patriarch)
on Jan 20, 2009 at 04:48 UTC ( [id://737476]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Why oh why is working with XML so bloomin' difficult in Perl?
in thread Modified title: The structures created by many of the XML parsers in Perl appear unnecessarily deep in levels...

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.

Replies are listed 'Best First'.
Re^4: Why oh why is working with XML so bloomin' difficult in Perl?
by admiral_grinder (Pilgrim) on Jan 20, 2009 at 20:00 UTC

    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.

      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.

      jeffa

      L-LL-L--L-LL-L--L-LL-L--
      -R--R-RR-R--R-RR-R--R-RR
      B--B--B--B--B--B--B--B--
      H---H---H---H---H---H---
      (the triplet paradiddle with high-hat)
      

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://737476]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-03-29 05:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found