<div dir="ltr">Hi Janosch.<div><br></div><div>Thanks for providing a clear test-case. I'd be interested in following up on this, can you file a bug report?</div><div><br></div><div>Cheers,</div><div>Alex</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 16 August 2017 at 09:18, Janosch Machowinski via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
while testing kdevelop 5, I ran into some problems with the code completion.<br>
I debugged it and tracked it down to the reparse step in libclang taking<br>
5 seconds in an i7-5930K.<br>
<br>
In my concrete example, I got a cpp file that consists of 173 line of code,<br>
with minor template usage.<br>
This program includes a big amount of headers, that use heavy templating.<br>
<br>
The initial parse takes 13 seconds, which is fine. What makes me wonder is<br>
the reparse step taking so long, as everything in the headers should be<br>
cached by the PCH.<br>
<br>
I prepared a git repo with an example, if you want to look at the code I used,<br>
or try it yourself.<br>
<br>
<a href="https://github.com/jmachowinski/clangTest" rel="noreferrer" target="_blank">https://github.com/jmachowinsk<wbr>i/clangTest</a><br>
<br>
It should be noted, that I do not set CXTranslationUnit_Incomplete,<br>
as kdevelop needs the flag to be NOT set. Setting the flag speeds up reparse<br>
to 0.5 seconds.<br>
<br>
Greetings<br>
    Janosch<br>
<br>
<br>
Debug output :<br>
<br>
Parse start<br>
Precompiling preamble:   8.2960 (100.0%)   0.2760 (100.0%)   8.5720 (100.0%)   8.5706 (100.0%)<br>
Parsing ../test/tdot_asguard.cpp:   4.8320 (100.0%)   0.0200 (100.0%)   4.8520 (100.0%)   4.8499 (100.0%)<br>
  ASTContext: expressions, declarations, and types: 254289451<br>
  ASTContext: identifiers: 507904<br>
  ASTContext: selectors: 4096<br>
  ASTContext: side tables: 9053176<br>
  Code completion: cached global results: 0<br>
  SourceManager: content cache allocator: 86016<br>
  SourceManager: malloc'ed memory buffers: 2070147<br>
  SourceManager: mmap'ed memory buffers: 0<br>
  SourceManager: data structures and tables: 124472904<br>
  ExternalASTSource: malloc'ed memory buffers: 0<br>
  ExternalASTSource: mmap'ed memory buffers: 188282552<br>
  Preprocessor: malloc'ed memory: 306782<br>
  Preprocessor: PreprocessingRecord: 838904<br>
  Preprocessor: header search tables: 43<br>
Parse took 13.4559<br>
Cache global code completions for ../test/tdot_asguard.cpp:   0.1280 (100.0%)   0.1280 (100.0%)   0.1267 (100.0%)<br>
Reparsing ../test/tdot_asguard.cpp:   5.0600 (100.0%)   0.0440 (100.0%)   5.1040 (100.0%)   5.1043 (100.0%)<br>
  ASTContext: expressions, declarations, and types: 259532331<br>
  ASTContext: identifiers: 2326528<br>
  ASTContext: selectors: 4096<br>
  ASTContext: side tables: 9151480<br>
  Code completion: cached global results: 4063232<br>
  SourceManager: content cache allocator: 111147<br>
  SourceManager: malloc'ed memory buffers: 2082327<br>
  SourceManager: mmap'ed memory buffers: 0<br>
  SourceManager: data structures and tables: 124472904<br>
  ExternalASTSource: malloc'ed memory buffers: 0<br>
  ExternalASTSource: mmap'ed memory buffers: 188282552<br>
  Preprocessor: malloc'ed memory: 8324702<br>
  Preprocessor: PreprocessingRecord: 1775864<br>
  Preprocessor: header search tables: 43<br>
ReParse took 5.10452<br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
</blockquote></div><br></div>