http://qs321.pair.com?node_id=1185266


in reply to Fastest way of XML -> perl structure

Many years ago at university, I wrote a GUI program that had to read, seek and render mzXML files on the fly. These files contained 1-600 MB of data, although some of it was in flattened substructures contained by the main XML structure. XML::Twig saved my bacon. It allowed very fast seeking and navigating the file without having to keep most of it in memory. When you do need to read a subtree into memory, it's trivial.

However, it's hard to say whether XML::Twig (or XML::LibXML as also suggested) will be of any help without knowing a bit more about the input data. Is there something peculiar about the structure of the XML files, like very deep hierarchies, or hundreds of attributes per element, or something else that would explain the slowness in parsing?

  • Comment on Re: Fastest way of XML -> perl structure