I'm using TinyXml to parse and create XML documents that contain encrypted documents as text nodes. For big documents (> 1MB) this yields very large text nodes .
When parsing such an xml document from a file, it took about 6 minutes to parse a 1Mb text node.
To increasy performance I have tried the following change to the TiXmlText::Parse() function (I'm stilll using version 1.2.4):
- First determine the length of the text after parsing
- preallocate memory for the parsing result using the std::string.reserve() function
- then do the actuel parsing
This modification reduced the parsing time to 1-2 seconds.
A similar approach could als be applied to the ReadText function in the latest version of TinyXml.
Art.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
TinyXML is superb, my ONLY problem is that the XML doc I'm generating and working with is well over 3mb and it's taking an age to load. I'm rather new to c++ so if you could post code snippets for your quantum increase in performance I'd be a very happy coder.
many thanks, ed.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm using TinyXml to parse and create XML documents that contain encrypted documents as text nodes. For big documents (> 1MB) this yields very large text nodes .
When parsing such an xml document from a file, it took about 6 minutes to parse a 1Mb text node.
To increasy performance I have tried the following change to the TiXmlText::Parse() function (I'm stilll using version 1.2.4):
- First determine the length of the text after parsing
- preallocate memory for the parsing result using the std::string.reserve() function
- then do the actuel parsing
This modification reduced the parsing time to 1-2 seconds.
A similar approach could als be applied to the ReadText function in the latest version of TinyXml.
Art.
Let's post a patch to 2.1.4 TiXmlBase::ReadText() and/or 1.2.4 TiXmlText::Parse() to speed others up too.
TinyXML is superb, my ONLY problem is that the XML doc I'm generating and working with is well over 3mb and it's taking an age to load. I'm rather new to c++ so if you could post code snippets for your quantum increase in performance I'd be a very happy coder.
many thanks, ed.