Review Request 123810: Make code-completion faster

Sergey Kalinichev kalinichev.so.0 at gmail.com
Sun May 17 10:34:59 UTC 2015



On May 16, 2015, 12:04 p.m., Sergey Kalinichev wrote:
> > That speedup sounds really good. I wonder if we shouldn't add some warning output if it has to fallback to findDeclaration so that we know if we're missing something that should be added to the cache. Or are there some known cases that aren't worth adding?
> > 
> > Caching the cache might be worth something as well... I don't have the time to look into this now, but I wonder if the symbol table could be used directly for the lookup since we already have the qid? This wouldn't find function-local declarations, but that could be handled specially.

>I wonder if we shouldn't add some warning output if it has to fallback to findDeclaration so that we know if we're missing something that should be added to the cache. Or are there some known cases that aren't worth adding?

The latter one. There'll be about 10-50 items out of 3-5 thousand, like: NS::Enem::Enumerator when completion invoked in the function scope ( i.e. the Other context)

>Caching the cache might be worth something as well... I don't have the time to look into this now, but I wonder if the symbol table could be used directly for the lookup since we already have the qid? This wouldn't find function-local declarations, but that could be handled specially.

Are you suggesting to use the symbol table lookup instead of calling allDeclarations/findDeclaration? I don't think it's worth it, because e.g. for me the allDeclarations call takes about 30ms, clang code-completion about 70ms and processing all those thousands of completion items 100ms.


- Sergey


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/123810/#review80455
-----------------------------------------------------------


On May 16, 2015, 11:13 a.m., Sergey Kalinichev wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/123810/
> -----------------------------------------------------------
> 
> (Updated May 16, 2015, 11:13 a.m.)
> 
> 
> Review request for KDevelop.
> 
> 
> Repository: kdev-clang
> 
> 
> Description
> -------
> 
> Instead of calling findDeclarations for each item found by clang, call allDeclarations once and cache the result. In case it can't find anything fall back to the findDeclarations.
>     
> This reduces code-completion time on average from 2000ms to 200ms for me.
> 
> 
> Diffs
> -----
> 
>   codecompletion/context.cpp 5027dcd 
> 
> Diff: https://git.reviewboard.kde.org/r/123810/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Sergey Kalinichev
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20150517/76a90d9b/attachment.html>


More information about the KDevelop-devel mailing list