[Kst] QTextStream to QDomElement

Andrew Walker arwalker at sumusltd.com
Fri Jan 14 19:41:43 CET 2005


Probably the best argument against it. However, it does
have the benefit of enforcing good practices. If we
had used QDomElement from the beginning it would
have given people a good reason to do this:

<plot x=2 y=4... / >

instead of

<plot>
	<x>2<x/>
	<y>2<y/>
	.
	.
	.
<plot/>

The kst files would all be half the size they are now. If we're
routinely posting 300kB kst files to ELOG then I would argue
that this matters.

Andrew

On Friday 14 January 2005 10:34, Barth Netterfield wrote:
> How about if we don't do it because it just doesn't matter?
>
> On January 14, 2005 01:25 pm, Andrew Walker wrote:
> > 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?
> >
> > Andrew
> >
> > 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.
> >
> > _______________________________________________
> > Kst mailing list
> > Kst at kde.org
> > https://mail.kde.org/mailman/listinfo/kst
>
> _______________________________________________
> Kst mailing list
> Kst at kde.org
> https://mail.kde.org/mailman/listinfo/kst



More information about the Kst mailing list