Why is "Show uses" sometimes so slow?

Milian Wolff mail at milianw.de
Wed May 30 11:49:07 UTC 2012


On Wednesday 30 May 2012 10:39:19 Alexandre Courbot wrote:
> On Tue, May 29, 2012 at 5:18 PM, Alexandre Courbot <gnurou at gmail.com> wrote:
> > This part of the code looks fun actually. I just wonder what happens
> > when the "Show Uses" progress bar is advancing. Milian, would there be
> > some documentation somewhere that I failed to see to let me start
> > faster on this?
>
> Also noticed yesterday that uses only refer to top contexts (i.e.
> source file). If this means every referred top context must be scanned
> for matching uses, that may explain why they don't scale satisfyingly
> with huge projects like the kernel.

This is exactly the reason why this is (still) slow. David recently sped the 
thing up a bit by grepping the project files first and thus limiting the 
amount of files that need to be checked for uses.

Still, this is slow the first time it's done... Reason is, as you figured out, 
that by default only visible declarations & contexts are found and stored on-
disk (enough for code completion, quickopen, ...).

As soon as you want to find uses though, all potential files must be reparsed 
with the AllDeclarationsContextsUses flag which takes time but is the only 
"correct" way to find *all* uses of a given declaration. Note that the 
implementation checks the cached version, and if it sees that the feature is 
satisfied, returns that version.

Thus the progress bar in the "find uses" view shows that a viable file was 
updated to include the uses feature.

Bye
-- 
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20120530/9942bef3/attachment.sig>


More information about the KDevelop-devel mailing list