I've a problem with exporting several very long std::string with Irrlichts XML-Writer. The strings can go up to 1,000,000 chars in size.
Exporting several of them takes 12 minutes for 1.9 MB resulting XML, which seems extremly slow.
The code looks like this:
- cpp Code: Select all
// create File
irr::io::IWriteFile* file = FileSystem->createAndWriteFile(_filename);
// create XML-Writer
irr::io::IXMLWriter* xmlWriter = FileSystem->createXMLWriter(file);
for (unsigned int i = 0; i<Fraktal->FraktalIteration.size() ; i++)
// close File
As mentioned, the datatype for Fraktal->FraktalIteration.at(i) is std::string.
Maybe someone has an idea why it's so slow - is this the fault of the XML-Writer or something other?
How could I speed this up?
As a note: I don't think that the datatype conversion from std::string to (const wchar_t* ), which is done by irr::core::stringw(Fraktal->FraktalIteration.at(i).c_str()).c_str(), is the problem.
I tried the same thing without writing it to XML, and it was really fast.