summaryrefslogtreecommitdiffstats
path: root/examples/desktop
diff options
context:
space:
mode:
authorAriya Hidayat <ariya.hidayat@nokia.com>2009-08-28 15:26:32 (GMT)
committerAriya Hidayat <ariya.hidayat@nokia.com>2009-08-31 09:18:11 (GMT)
commit7f1d1eaeb1dbe7b0951e4b3c47b27c7dc95eb7c1 (patch)
treeeb056bb24a38b7f533d7dfe51a39650a8920edbc /examples/desktop
parent3216fe93a400980ec9d1a4eeafa1c700db56ded2 (diff)
downloadQt-7f1d1eaeb1dbe7b0951e4b3c47b27c7dc95eb7c1.zip
Qt-7f1d1eaeb1dbe7b0951e4b3c47b27c7dc95eb7c1.tar.gz
Qt-7f1d1eaeb1dbe7b0951e4b3c47b27c7dc95eb7c1.tar.bz2
Preemptively parse the necessary attributes in QSvgAttributes.
Previously, retrieving an attribute value requires a two-stage lookup, first in the XML attributes and (if it is found there) in the CSS attributes. Both look-ups requires a number of iterations and comparisons, which have to be carried out for every value look-up. This patch changes it so that iterations and comparisons need to be done only once, namely at the beginning. This requires us to store several SVG attributes needed by the parsing routine, but since they are just QStringRefs, the increase in the heap usage is really minimal and even not reported by Valgrind's Massif. Also, now we don't need to hold the XML attributes anymore. The loading of tiger.svg (tests/benchmarks/qsvgrenderer) is reduced from 101.2 millions instructions to 96.5. The biggest gain is however obvious from the time spent in QSvgAttributes::parseStyle(QSvgNode*, QSvgAttributes, QSvgHandler*) which goes down from 16.7 millions instructions to 6.9 millions, i.e. 2.4x faster. Even with the new extra overhead in the QSvgAttributes constructor, QSvgAttributes::parseStyle(QSvgNode*, QXmlStreamAttributes, QSvgHandler*) goes down from 23.5 millions instructions to 18.4 millions, i.e. 1.3x faster. Reviewed-by: Kim
Diffstat (limited to 'examples/desktop')
0 files changed, 0 insertions, 0 deletions