[cfe-dev] Tips for optimising libclang

Miguel Guedes miguel.a.guedes at gmail.com
Tue Apr 2 11:47:09 PDT 2013


Hi Tobias,

On Tue, 2013-04-02 at 19:45 +0200, Tobias Grosser wrote:
> Three points:
> 
> 1)
> 
> When developing clang_complete, we noticed that 
> clang_parseTranslationUnit was not enough to initialize the 
> PrecompiledPreamble completely. Instead, we had to issue a reparse 
> between the initial parse and the codeComplete command. I never found 
> out if this was something we did wrong or something that libclang did 
> not get right.
> 

Strange. I'm seeing the exact same behaviour you describe. As you say,
only after parsing and then reparsing do subsequent TU reparsing calls
finish dramatically quicker. However, creating the preamble is now
taking ~2500ms BUT subsequent updates take in the order of 250-260ms.
Still a bit too high though.

What timings do you experience with clang_complete when reparsing
following an edit?

Many thanks for the invaluable info, Tobias!

-- 
Miguel




More information about the cfe-dev mailing list