[Interest] Faster QXmlStreamWriter?

Thiago Macieira thiago.macieira at intel.com
Wed Apr 25 08:43:11 CEST 2018

On Tuesday, 24 April 2018 22:48:03 PDT alexander golks wrote:
> when using QJsonDocument you may/should pay attention to QtQTBUG-47629:
> QJsonObject size maximum length 128MB
> https://bugreports.qt.io/browse/QTBUG-47629

That's one of the reasons I'm adding CBOR support. The new implementation 
scales much better than the binary JSON memory and on-disk format and has no 
such limitation. Plus it's a standardised format, defined by the IETF and used 
several new IoT protocols.

Since it uses QVector internally, it's currently limited to 2 GB vectors per 
level, so each CBOR array can contain at most 2^31 / 16 = 2^27 elements. But 
that's on each level: each element can be an array of 2^27 elements again. 
Maps are limited to half that, so 2^26. There's also a limit on the total size 
of strings in a map or array.

The code was carefully written so that in Qt 6, when we switch to 64-bit size 
types for Qt containers, the limitations disappear.

And better: since CBOR is a full superset of JSON, the backend can be used to 
hold JSON too. So Qt 6 QJsonDocument & family will have the 128 MB limit 
removed, at the expense of the binary JSON format requiring parsing.

Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

More information about the Interest mailing list