[Kst] QTextStream to QDomElement

Andrew Walker arwalker at sumusltd.com
Fri Jan 14 19:25:08 CET 2005

Okay, so this demonstrates that the Qt implementation of XML
is very slow compared to other implementations. It doesn't say 
anything about how QDomElement compares to QTextStream
speed-wise though. Is it possible that QTextStream is just as bad?


On Friday 14 January 2005 10:15, George Staikos wrote:
> On Friday 14 January 2005 12:56, Andrew Walker wrote:
> > The first may be true. Have you actually measured this for the
> > kind of files we are saving? The second point I disagree with.
> > We should not have to be worrying about indentation,
> > endl, closing tags, delimiters, etc that QTextStream compels
> > us to. I'll reserve judgment on your third point.
>    QDom is known to be very slow.
> http://xmlbench.sourceforge.net/results/benchmark200402/index.html
> I also saw some slides about this at a talk.
>    We are definitely dealing with big DOM documents too.  The ones in Paris
> were around 300kb (just the XML!!), and Nicolas uses .kst files even bigger
> than that.
>     There are future cases where we will also need to extract fragments of
> the DOM as text, so we will be even more wasteful there, creating a
> complicated heavyweight structure only to convert back to text, and then
> back to DOM again.
>     Finally, write out an example both ways and you'll see that it's much
> more tedious to write with QDom.  The indentation stuff is not necessary,
> but it was very easy to sneak in and makes it easier to deal with those
> files for debugging.
>    QDom is certainly more elegant than QTextStream, but it's not "ready"
> yet.
>    Note: QDom4 will be much faster than libxml even, apparently, so it
> might change things a bit.  That's probably 1.5-2 years into Kst's future
> though.

More information about the Kst mailing list