QQuickText: Don't store node engine per node.
authorRobin Burchell <robin.burchell@viroteck.net>
Mon, 1 Jun 2015 16:03:04 +0000 (19:03 +0300)
committerRobin Burchell <robin.burchell@viroteck.net>
Sat, 6 Jun 2015 11:33:31 +0000 (11:33 +0000)
commit8555cdecd66444b07ab09b1644cb42fcb572dd76
tree61a6b724974416b133db8a503a4d75c3381ec8b9
parent180ad9f05e873551d28e25b4840bf1c02b1ef7ee
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>
src/quick/items/qquicktextedit.cpp
src/quick/items/qquicktextedit_p_p.h
src/quick/items/qquicktextnode.cpp
src/quick/items/qquicktextnode_p.h