From 9983cccf14d04d1d9e3520428599f06e03b8321d Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Tue, 15 Apr 2014 15:28:06 +0200 Subject: V4 IR: reduce runtime cost. - Replace 2 QHash 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 --- src/qml/compiler/qv4jsir.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/qml/compiler/qv4jsir.cpp') 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()) -- cgit v1.2.3