1

Which XML library for C++ uses the lowest amount of RAM while parsing e. g. 300M file? Ideally the choice should be restricted to one of RapidXml, Pugixml, Libxml, Boost, TinyXML.

wolfie
  • 97
  • 8

1 Answers1

2

You haven't clarified your complete requirements. There are 2 commonly used xml parsing models: DOM and SAX. In DOM the entire file is parsed into memory as a tree where as SAX is more of a event driven library. If you are

  1. not planning to modify the XML & just consume it and
  2. concerned about RAM usage

then using SAX model will be optimum. I will be surprised if half decent implementation of SAX is memory intensive. Also look at this post: Light weight C++ SAX XML parser

Community
  • 1
  • 1
Paani
  • 560
  • 3
  • 11
  • 1
    Good, go for SAX library. I have used Xerces C++ DOM parser a lot. Works well. Xerces also has a SAX parser which you should look into. – Paani Aug 06 '15 at 15:14
  • if I chose one of those mentioned in my Q for performance reasons, which one is most RAM efficient? – wolfie Aug 06 '15 at 15:57