diff options
author | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2016-03-03 13:38:27 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2016-03-11 09:19:01 +0000 |
commit | 6300f4dde0ab3279b18a0fb29f94cfe142557cba (patch) | |
tree | 4158af34ad0e812fa50f8b046f54439411ebc151 /tests/auto/quick/qquickmousearea/qquickmousearea.pro | |
parent | 9ca9de7cbc8b045c19899987d6666576399af33d (diff) |
QmlDebug: Reuse packets instead of deleting and recreating them
This reduces memory churn as we don't have to reallocate the various
QPacket, QBuffer, QByteArray objects and their private classes all the
time. Also, subsequent packets often have similar sizes, which makes it
beneficial to preallocate the underlying byte array to the size of the
previous packet on clear(). In order not to carry the extra reserved
space in the lists passed to the debug server, we squeeze the byte
arrays before inserting them into the lists. That detaches and copies
them, which would have been done anyway when reusing the same packet
for the next message.
The result is a reduction in the number of temporary memory allocations
from QQmlProfilerServiceImpl::sendMessages() by about 75%.
Change-Id: Ief98cd7a93a2e8e840e111dee6b346cae00e06bf
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'tests/auto/quick/qquickmousearea/qquickmousearea.pro')
0 files changed, 0 insertions, 0 deletions