Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6928531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:12:00+00:00 2026-05-27T11:12:00+00:00

In my project I need append new data to a xml, so I do

  • 0

In my project I need append new data to a xml, so I do it like below:
the question is the LoadFile() funcation is so slowly when the xml file is large, and high-cpu, the SaveFile() have same problem. So, How should I speed up in my project.
Thanks you help:)

        TiXmlDocument doc(m_filePath.c_str()); 
    (void)doc.LoadFile(); //here is slowly
    if (doc.Error() && (doc.ErrorId()==TiXmlBase::TIXML_ERROR_OPENING_FILE))
    {
        ATS_LOG(ERROR, "Can not open the file:%s", m_filePath.c_str());
        result = false; 
    }
    else
    {
        const TiXmlHandle docH(&doc); 
        TiXmlElement* const element = docH.FirstChildElement("HistoryMsgs").Element();
        TiXmlNode* const pNode=element->ToElement();
        if (pNode!=NULL)
        {
                            //do something that insert new node;
            (void)doc.SaveFile(m_filePath.c_str());//here is slowly too
        }
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T11:12:00+00:00Added an answer on May 27, 2026 at 11:12 am

    TinyXML has quite some performance issues. RapidXML and PugiXML are more preferred. I’m not sure how easy would it be to port your code to a new parser, but I had performance issues once with TinyXML and then switched to PugiXML. You might check out a discussion on C++ parsers on:
    What is the best open XML parser for C++?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

to my project i need document editor for many types of documents(tabular data, invoices,
In one of the configuration files for my project I need to append some
I have several projects where I need to append strings to a BSTR/CComBSTR/_bstr_t object
my project need to read multiple web pages at a time(eg: for a particular
My project need to compare output(only urls) of google and yahoo for a particular
The Junits I have in my project need to load property files from the
For a project I need to read and write ESRI shapefiles. It should be
In my project I need to create a business object validation layer that will
In a current project I need to support finding a User by login credentials
In my project I need to write small WYSIWYG editor (just let users make

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.