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.
Asked
Active
Viewed 1,280 times
1 Answers
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
- not planning to modify the XML & just consume it and
- 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
-
1Good, 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