[Kst] QTextStream to QDomElement
George Staikos
staikos at kde.org
Fri Jan 14 19:15:49 CET 2005
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.
--
George Staikos
KDE Developer http://www.kde.org/
Staikos Computing Services Inc. http://www.staikos.net/
More information about the Kst
mailing list