DUChain: Prioritize active documents
ClosedPublic

Authored by kfunk on Mar 15 2016, 9:41 AM.

Details

Summary

Prioritize document parsing in the background parser for documents which
just have been activated (i.e. the UI switched to a view of this
particular document).

Testing: Start up heaptrack session, with around 20 tabs open. Switch to
another tab at start up.
Observation: See that the current document in the tab gets a high priority in the background parser.

BUG: 358483

Diff Detail

Repository
R33 KDevPlatform
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kfunk updated this revision to Diff 2776.Mar 15 2016, 9:41 AM
kfunk retitled this revision from to DUChain: Prioritize active documents.
kfunk updated this object.
kfunk edited the test plan for this revision. (Show Details)
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptMar 15 2016, 9:41 AM
kfunk updated this revision to Diff 2777.Mar 15 2016, 9:42 AM

Remove unrelated hunks

mwolff accepted this revision.Mar 15 2016, 12:37 PM
mwolff added a reviewer: mwolff.
mwolff added a subscriber: mwolff.

cool, thanks for this! small nitpicks, otherwise good to go.

one question though: when we startup kdevelop with ~20 documents open, are they activated one after the other, leading to ~20 high priority parse jobs? that would need to be work-arounded via a timer then I think... If this is the case (and I actually fear that's the case), then I'd leave the function you touched as-is and only change the background parser to increase priority of activated documents after some time

could we get a unit test for this as well? would be nice to have I think, but not too important

language/duchain/duchain.cpp
1471

just "update", remove dash

1472

you could just write a bool flag here, i.e.

addWithHighPriority = true;

and then...

1480

check for addWithHighPriority || ... here, as the call to addDocument is equal in both cases, no?

This revision is now accepted and ready to land.Mar 15 2016, 12:37 PM
In D1145#21781, @mwolff wrote:

cool, thanks for this! small nitpicks, otherwise good to go.

one question though: when we startup kdevelop with ~20 documents open, are they activated one after the other, leading to ~20 high priority parse jobs? that would need to be work-arounded via a timer then I think... If this is the case (and I actually fear that's the case), then I'd leave the function you touched as-is and only change the background parser to increase priority of activated documents after some time

It's not the case here. If I start with those 20 documents, then the last-opened gets high prio + the one I'm switching to. Just those.

could we get a unit test for this as well? would be nice to have I think, but not too important

Will check.

This revision was automatically updated to reflect the committed changes.