diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2018-07-23 14:08:06 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2018-07-31 17:08:08 +0000 |
commit | 8237f645a33199e0a8aded0a3f7e6077990707fd (patch) | |
tree | 2011793b9c3775f307cd5e2560143017ddb57719 /src/qml/compiler/qqmlirbuilder.cpp | |
parent | 9337b1c339c34cd4fe10d236be2ee61ca76e17ba (diff) |
Optimize memory consumption of ahead-of-time compile cache files
When loading a pre-compiled cache file, the strings contained therein
will remain available in memory since commit
7dcada48d2435e8ceb0cc8a6771f79b76979e11f. While for aot built cache
files we may have to add new strings (for example for signal handler
parameters), we can re-use the existing strings by omitting them from
the intermediately created string table.
This saves ~283K RAM with qtquickcontrols1 gallery.
Task-number: QTBUG-69588
Change-Id: I8ea807f6dea4cc35d8b7e5f7329809ed1cd12880
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/compiler/qqmlirbuilder.cpp')
-rw-r--r-- | src/qml/compiler/qqmlirbuilder.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/qml/compiler/qqmlirbuilder.cpp b/src/qml/compiler/qqmlirbuilder.cpp index 88527b0d94..511b953eaa 100644 --- a/src/qml/compiler/qqmlirbuilder.cpp +++ b/src/qml/compiler/qqmlirbuilder.cpp @@ -2352,9 +2352,7 @@ IRLoader::IRLoader(const QV4::CompiledData::Unit *qmlData, QmlIR::Document *outp void IRLoader::load() { - output->jsGenerator.stringTable.clear(); - for (uint i = 0; i < unit->stringTableSize; ++i) - output->jsGenerator.stringTable.registerString(unit->stringAtInternal(i)); + output->jsGenerator.stringTable.initializeFromBackingUnit(unit); for (quint32 i = 0; i < unit->nImports; ++i) output->imports << unit->importAt(i); |