diff options
author | Erik Verbruggen <erik.verbruggen@digia.com> | 2014-04-15 15:28:06 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-15 15:31:37 +0200 |
commit | 9983cccf14d04d1d9e3520428599f06e03b8321d (patch) | |
tree | 9a84bc86e9e060ef29e5c36c4293f82a42634e25 /src/qml/compiler/qv4jsir.cpp | |
parent | c7c3d03391ad4f1c6a914b32780eb786712f61e4 (diff) |
V4 IR: reduce runtime cost.
- Replace 2 QHash<BasicBlock *, ...> with QVector<...>, where the
basic-block index is the index of the vector.
- Nearly all QHashes and QSets will have a minimal fill rate. So,
initialize/reserve all of them with a reasonable minimal size to
prevent re-allocations and re-hashing.
Change-Id: Iade857991d73fddd0b92cecb8d458064b253a08d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4jsir.cpp')
-rw-r--r-- | src/qml/compiler/qv4jsir.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4jsir.cpp b/src/qml/compiler/qv4jsir.cpp index a067a95104..d77a92eab1 100644 --- a/src/qml/compiler/qv4jsir.cpp +++ b/src/qml/compiler/qv4jsir.cpp @@ -164,6 +164,7 @@ struct RemoveSharedExpressions: IR::StmtVisitor, IR::ExprVisitor void operator()(IR::Function *function) { subexpressions.clear(); + subexpressions.reserve(function->basicBlockCount() * 8); foreach (BasicBlock *block, function->basicBlocks()) { if (block->isRemoved()) |