[Kst] QTextStream to QDomElement
George Staikos
staikos at kde.org
Fri Jan 14 19:32:58 CET 2005
On Friday 14 January 2005 13:25, 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?
It is slow relative to fprintf, yes. It should not be as slow as QDom,
especially under malloc pressure. Write a testcase that writes out 100000
XML nodes to a QString at various nesting levels with text and attributes
using QDom vs QTextStream, not in a tight loop, not reusing QDom nodes in any
unrealistic way that we wouldn't be able to do with hierarchical writing.
Even if it shows that QTextStream is inefficient, we actually should really
consider using a QIODevice instead of QTextStream probably. Then we can
attach to the QIODevice with a QTextStream if desired. There's just no need
to change it at this point.
--
George Staikos
KDE Developer http://www.kde.org/
Staikos Computing Services Inc. http://www.staikos.net/
More information about the Kst
mailing list