D9006: KDevelop project file manager: avoid concurrent reloads and represent jobs in the runController
René J.V. Bertin
noreply at phabricator.kde.org
Sun Nov 26 15:12:09 UTC 2017
rjvbb created this revision.
Restricted Application added a subscriber: kdevelop-devel.
This is a bit more proper presentation of the pseudo-patch presented in https://bugs.kde.org/show_bug.cgi?id=387238 "concurrent project directory reloading".
Probably not very useful in the current code base so I'm not expecting this to be upstreamed or to get much constructive feedback (so don't feel obliged).
Which is why I'm lumping 2 related things in the same patch:
1. prevent the CPU cost and possible other side-effects of frequent project reloads (leading to concurrent FileManagerListJobs); see #387238 for discussion when this can happen.
2. represent FileManagerListJobs in the runController. This uses a proxy KJob derative so the runController can take control over its management.
1. is, I think, *a* proper way to compress reload requests. It cancels reloads queued or already running for the target directory or one of its subdirs and adds a cool-off delay before jobs are actually started (so they won't have used any CPU if overridden soon enough after having been scheduled).
There may be better implementations, this one is least-change and has the advantage that everything continues to work when there are only sporadic reload requests.
2. was mostly a fun hack of a feature I've been missing and that now shows me why KDevelop is sometimes not as responsive as it might be. Other than that it's probably as useful as showing unnamed and/or unkillable jobs in the runController.
1. does exactly what I hoped for tested while running configure on a bigger in-tree build project like CodeBlocks with KDevelop configured to monitor directories for and reload them in case of changes. Not profiled formally, the effect is clear from following CPU usage in top, from fan noise, and from the runController buttons not turning on in the toolbar.
2. tested on Mac and Linux. Works as expected except for the fact that the initial project load puts TWO entries in the "stop individual job" dropdown menu. There are no duplicate proxies as far as can tell so this escapes me still.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the KDevelop-devel