Xml Parser, C++

Started by
24 comments, last by ChaosEngine 7 years, 8 months ago

Advantages of TinyXML-2
...
Many fewer memory allocation (1/10th to 1/100th), uses less memory (about 40% of TinyXML-1), and faster (~5x on read).
...

I tried TinyXML-2 and it's still a memory hog. The conversion from TinyXML was very easy.

Advertisement

It's not XML, but writing a parser with lex/yacc (or flex/bison) isn't that complicated. As you design the input language, you can make it as bloated as you like :)

Anyone use RapidXML?

Anyone use RapidXML?



The first two responses to this thread cite RapidXML.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

Anyone use RapidXML?



The first two responses to this thread cite RapidXML.

Thank you. My memory isn't so hot.

Advantages of TinyXML-2
...
Many fewer memory allocation (1/10th to 1/100th), uses less memory (about 40% of TinyXML-1), and faster (~5x on read).
...

I tried TinyXML-2 and it's still a memory hog. The conversion from TinyXML was very easy.

TinyXML is a DOM based parser. This means it has to load the entire document into memory first. For a lot of applications, that's fine (desirable even).

If memory is an issue, you could look at a SAX based parser, which uses an event-driven model to process the XML. This uses less memory, but it isn't as easy to program with (in general, YMMV).

For C++ sax parsers, you can use Xerces or Libxml++ (there may be others, those are the two I have used).

if you think programming is like sex, you probably haven't done much of either.-------------- - capn_midnight

This topic is closed to new replies.

Advertisement