[Interest] Faster QXmlStreamWriter?

Maurice Kalinowski Maurice.Kalinowski at qt.io
Wed Apr 25 07:46:43 CEST 2018


> On Tuesday, 24 April 2018 09:39:37 PDT Julien Cugnière wrote:
> > 2018-04-24 17:52 GMT+02:00 Thiago Macieira <thiago.macieira at intel.com>:
> > > On Tuesday, 24 April 2018 07:39:08 PDT Konstantin Tokarev wrote:
> > >> If your serialized data is intended to be read by Qt applications
> > >> only, QDataStream may be a good choice
> > >
> > > Also slow.
> > >
> > > Binary QJsonDocument is the fastest, followed closely by QCborValue
> > > (new in 5.12).
> >
> > Out of curiosity, what makes QDataStream slow? From your other
> comment
> > on QBuffer, it sounds like it might be related to the QIODevice
> > interface. Does that mean it's impossible to get best performance
> > through QIODevice, because of some design flaw? Or is there something
> > else that makes QDataStream and QBuffer slow?
> 
> I benchmarked the full result, but didn't investigate what makes
> QDataStream slow. But it suffers from the same problem that
> QXmlStreamWriter does: it uses a QBuffer to write to a QDataStream (see [1]
> and [2]). QCborStreamWriter does the same, actually -- I've only fixed
> QCborStreamReader to bypass it.
> 
[Maurice Kalinowski] 

Hey,

Would you still have these benchmarks somewhere? I am currently playing around with various serialization ways as well, and so far came to different conclusions. Probably because of using different means, but would still like to see how you approached it for plain text json.

BR,
Maurice



More information about the Interest mailing list