Boost.PropertyTree is basically not a fast or light parser.
It focuses on providing high-level convenience and functionality, so it is not built to be effective, I think.
You can see this thread on the extended mailing list for a similar question.
I would suggest that the alternative to Boost.PropertyTree could be either:
- a SAX parser is another approach for parsing XML. This is the opposite of a DOM parser; it parses the XML nodes one by one. Usually the "memory allocation for the entire file at the beginning" occurs in the DOM parser, but this does not happen in SAX parsers.
- parser + user-defined memory pool allocated using the allocator - you can configure the allocator of such parsing to indicate a stable memory pool. It can be just a large buffer of pre-allocated memory, a fragmentation pool, or even a file with memory mapping, etc.
saki7 source share