wolfie
wolfie

Reputation: 97

C++ XML parsing library for large files with low RAM consumpion

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.

Upvotes: 1

Views: 1430

Answers (1)

Paani
Paani

Reputation: 560

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

Upvotes: 2

Related Questions