Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.6.1, 4.6.2, 4.6.3
-
None
-
c7fcd56bd3e150e57230ea1445bf4286b3f3fabe
Description
When using a QXmlStreamReader with a QByteArray as input, the whole QByteArray gets copied internally when calling QXmlStreamReader::readNextStartElement() for the first time.
This is a very serious issue when using big input xml data (> 50 MB).
The QByteArray gets copied in:
ushort QXmlStreamReaderPrivate::getChar_helper() { // ... // line 1526 decoder->toUnicode(&readBuffer, rawReadBuffer.data(), nbytesread); }
My suggestion is to use:
decoder->toUnicode(&readBuffer, rawReadBuffer.constData(), nbytesread);
instead. QSharedDataPointer should not copy the byte array then.
Parsing without copying is quite crucial for our application.