Review Request 123810: Make code-completion faster

Olivier Jean de Gaalon olivier.jg at gmail.com
Sat May 16 09:04:55 UTC 2015


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



codecompletion/context.cpp (line 427)
<https://git.reviewboard.kde.org/r/123810/#comment55177>

    const



codecompletion/context.cpp (line 430)
<https://git.reviewboard.kde.org/r/123810/#comment55178>

    Could building this hash be moved to a function in the anon namespace?



codecompletion/context.cpp (line 434)
<https://git.reviewboard.kde.org/r/123810/#comment55179>

    const auto



codecompletion/context.cpp (line 439)
<https://git.reviewboard.kde.org/r/123810/#comment55180>

    const auto*


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.

- Olivier Jean de Gaalon


On May 16, 2015, 8: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, 8: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/20150516/db149bd2/attachment.html>


More information about the KDevelop-devel mailing list