diff options
author | Robin Burchell <robin.burchell@viroteck.net> | 2015-06-01 19:03:04 +0300 |
---|---|---|
committer | Robin Burchell <robin.burchell@viroteck.net> | 2015-06-06 11:33:31 +0000 |
commit | 8555cdecd66444b07ab09b1644cb42fcb572dd76 (patch) | |
tree | 61a6b724974416b133db8a503a4d75c3381ec8b9 /src/quick/items/qquicktextedit_p_p.h | |
parent | 180ad9f05e873551d28e25b4840bf1c02b1ef7ee (diff) |
QQuickText: Don't store node engine per node.
Since these are only used during one particular phase of dealing with text, it
is extremely wasteful to heap allocate them and keep them around for the entire
lifetime of the node (~3kb of total allocation _each_ according to OS X).
Removing these cuts around 100mb of transient allocations off the qmlbench text
creation benchmark (and takes the total allocations during a test run from
~496 MB to ~389 MB). It also improves the approximate throughput for creation
of text items by ~5%.
Change-Id: I45c8a50879ed545da1fb13ab3c2c5d857b112cf7
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Diffstat (limited to 'src/quick/items/qquicktextedit_p_p.h')
-rw-r--r-- | src/quick/items/qquicktextedit_p_p.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/quick/items/qquicktextedit_p_p.h b/src/quick/items/qquicktextedit_p_p.h index 20c0d1ca9c..a6e6faeaa1 100644 --- a/src/quick/items/qquicktextedit_p_p.h +++ b/src/quick/items/qquicktextedit_p_p.h @@ -57,6 +57,7 @@ class QTextLayout; class QQuickTextDocumentWithImageResources; class QQuickTextControl; class QQuickTextNode; +class QQuickTextNodeEngine; class QQuickTextEditPrivate : public QQuickImplicitSizeItemPrivate { @@ -126,7 +127,7 @@ public: void setNativeCursorEnabled(bool) {} void handleFocusEvent(QFocusEvent *event); - void addCurrentTextNodeToRoot(QSGTransformNode *, QQuickTextNode*, TextNodeIterator&, int startPos); + void addCurrentTextNodeToRoot(QQuickTextNodeEngine *, QSGTransformNode *, QQuickTextNode*, TextNodeIterator&, int startPos); QQuickTextNode* createTextNode(); #ifndef QT_NO_IM |