Menu

Parsing large text nodes

Anonymous
2002-08-13
2002-12-08
  • Anonymous

    Anonymous - 2002-08-13

    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.

     
    • Andrej

      Andrej - 2002-08-16

      Let's post a patch to 2.1.4 TiXmlBase::ReadText() and/or 1.2.4 TiXmlText::Parse() to speed others up too.

       
    • Ed Burton

      Ed Burton - 2002-12-08

      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.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.