diff options
author | Robin Burchell <robin.burchell@viroteck.net> | 2014-12-21 20:15:09 +0100 |
---|---|---|
committer | Robin Burchell <robin.burchell@viroteck.net> | 2015-01-07 21:35:58 +0100 |
commit | c3b6a6413636a17a74e777e65d271954392867ca (patch) | |
tree | 0304461c99673c86f301b95fd1e46996fa31ef5e /src/qml/compiler/qv4ssa.cpp | |
parent | ba690fb73864915b4a35bbec5b7dc134ff1dafd0 (diff) |
QV4: Lower time spent in indirections and allocations.
Change data type for defsUntyped from QList -> QVector & reserve space when
creating the list. Drops ~250ms off a pretty morbid QML testcase, most, but not
all of which was spent in allocations.
Change-Id: I2ed8c62e7d41ab353a0194da268a2b430f079474
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4ssa.cpp')
-rw-r--r-- | src/qml/compiler/qv4ssa.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/qml/compiler/qv4ssa.cpp b/src/qml/compiler/qv4ssa.cpp index 77cfab8f6f..69be6b3beb 100644 --- a/src/qml/compiler/qv4ssa.cpp +++ b/src/qml/compiler/qv4ssa.cpp @@ -1145,9 +1145,10 @@ public: defUse.blockOfStatement = defBlock; } - QList<UntypedTemp> defsUntyped() const + QVector<UntypedTemp> defsUntyped() const { - QList<UntypedTemp> res; + QVector<UntypedTemp> res; + res.reserve(tempCount()); foreach (const DefUse &du, _defUses) if (du.isValid()) res.append(UntypedTemp(du.temp)); @@ -2524,7 +2525,7 @@ public: Q_UNUSED(f); QVector<UntypedTemp> knownOk; - QList<UntypedTemp> candidates = _defUses.defsUntyped(); + QVector<UntypedTemp> candidates = _defUses.defsUntyped(); while (!candidates.isEmpty()) { UntypedTemp temp = candidates.last(); candidates.removeLast(); |