summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorAriya Hidayat <ariya.hidayat@nokia.com>2009-09-02 13:51:47 +0200
committerAriya Hidayat <ariya.hidayat@nokia.com>2009-09-03 13:42:40 +0200
commite3c62dc1def9270761ca63c73ae76fdca9d61582 (patch)
tree4d6d091ab3533fc2876e451160cfdf04a4c4c42a /util
parent5e3775ae4c5263a25e63868e8a3f16244e4dde02 (diff)
downloadqt4-tools-e3c62dc1def9270761ca63c73ae76fdca9d61582.tar.gz
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 3976632651..299ff5ec96 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