diff options
author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2023-04-23 18:58:31 +0200 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@qt.io> | 2023-04-25 12:58:22 +0000 |
commit | f46f9ac43253f486cccefd7b453142630d10a612 (patch) | |
tree | 345bb6fc2ef12470ecb158fc11fe4f6d3ef4114f /src/plugins/bazaar/bazaarcommitwidget.cpp | |
parent | b9ca680b0384bbe4cba7a11df549c31177d0fff1 (diff) | |
download | qt-creator-f46f9ac43253f486cccefd7b453142630d10a612.tar.gz |
AutoTest: Optimize starting task tree in TestCodeParser::scanForTests()
When loading a Qt project, after the Scanning For Tests
finished, the scanForTests() blocks the main thread for
about 2.5 seconds on the call to m_taskTree->start().
The reason is that created task tree contains about 8000
asynchronous tasks. If all they run in parallel it means
that we start them all synchronously.
Don't use internal QThreadPool, as it doesn't prevent
the freeze when more than maxTreadCount() threads
are started. Instead, use the parallel limit with the
same constraint that was used for thread pool.
It means that only constrained number of tasks are being
run in parallel and the rest is being postponed until
some of the running tasks finished. In this way starting
the constrained number of tasks reduces the GUI freeze
to ~0 ms on task tree start().
In general: this patch divides the overall freeze of
2.5 seconds evenly into many very small pieces and
distributes them evenly in time, so the GUI stays responsive.
This patch, when applied together with 2 bottom patches,
reduces the GUI freeze spent inside scanForTests() after loading
a Qt project and after Scanning For Tests finished
from about 23 seconds into 160 ms.
Change-Id: If33076d4f042c3d96434b9f3cc305776fb30906d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/bazaar/bazaarcommitwidget.cpp')
0 files changed, 0 insertions, 0 deletions