summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorAriya Hidayat <ariya.hidayat@nokia.com>2009-09-02 11:51:47 (GMT)
committerAriya Hidayat <ariya.hidayat@nokia.com>2009-09-03 11:42:40 (GMT)
commite3c62dc1def9270761ca63c73ae76fdca9d61582 (patch)
tree4d6d091ab3533fc2876e451160cfdf04a4c4c42a /util
parent5e3775ae4c5263a25e63868e8a3f16244e4dde02 (diff)
downloadQt-e3c62dc1def9270761ca63c73ae76fdca9d61582.zip
Qt-e3c62dc1def9270761ca63c73ae76fdca9d61582.tar.gz
Qt-e3c62dc1def9270761ca63c73ae76fdca9d61582.tar.bz2
CSS parser speed-up: skip the need to call toLower().
Instead of taking the lowercase of each tokenized character, it is better to encode the logic in the automaton itself. During the parsing of tiger.svg (tests/benchmarks/qsvgrenderer), the time spent inside QCssScanner_Generated::lex() goes down from 0.53 millions instructions to just 0.23 millions (2x faster). Autotests for qcssparser, qtextdocumentfragment, qstylesheet still pass. Reviewed-by: Simon Hausmann
Diffstat (limited to 'util')
-rw-r--r--util/lexgen/css2-simplified.lexgen3
1 files changed, 1 insertions, 2 deletions
diff --git a/util/lexgen/css2-simplified.lexgen b/util/lexgen/css2-simplified.lexgen
index 3976632..299ff5e 100644
--- a/util/lexgen/css2-simplified.lexgen
+++ b/util/lexgen/css2-simplified.lexgen
@@ -1,9 +1,8 @@
[Options]
-case-insensitive
classname = QCssScanner_Generated
[Code Generator Options]
-MapToCode[a-z] = (ch.unicode() >= 'a' && ch.unicode() <= 'z') || ch.unicode() >= 256
+MapToCode[a-z] = (ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256
TokenPrefix = QCss::
FileHeader = ../moc/licenseheader.txt