diff options
author | Ariya Hidayat <ariya.hidayat@nokia.com> | 2009-09-02 04:53:49 (GMT) |
---|---|---|
committer | Ariya Hidayat <ariya.hidayat@nokia.com> | 2009-09-02 07:52:20 (GMT) |
commit | 7578f43d0f1358b2ed52b3a5d2b853f26e63aec0 (patch) | |
tree | a11355ffa95a733309e90a0643f083e042ed4306 | |
parent | fb530ac0a12b90527b9792b31e08043518dd8bd7 (diff) | |
download | Qt-7578f43d0f1358b2ed52b3a5d2b853f26e63aec0.zip Qt-7578f43d0f1358b2ed52b3a5d2b853f26e63aec0.tar.gz Qt-7578f43d0f1358b2ed52b3a5d2b853f26e63aec0.tar.bz2 |
CSS parsing speed-up: reserve CSS symbols prior to parsing.
Let us be optimistic here and reserve some space in the CSS symbols
array before parsing starts. This gives 3% speed-up when loading
tiger.svg (tests/benchmarks/qsvgrenderer).
Reviewed-by: Olivier Goffart
-rw-r--r-- | src/gui/text/qcssparser.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp index 6978b45..f252444 100644 --- a/src/gui/text/qcssparser.cpp +++ b/src/gui/text/qcssparser.cpp @@ -2126,6 +2126,7 @@ void Parser::init(const QString &css, bool isFile) hasEscapeSequences = false; symbols.resize(0); + symbols.reserve(8); Scanner::scan(Scanner::preprocess(styleSheet, &hasEscapeSequences), &symbols); index = 0; errorIndex = -1; |