[cfe-dev] Clang indexing library performance

Tobias Grosser tobias at grosser.es
Sun Oct 2 14:44:46 PDT 2011


On 10/02/2011 12:27 PM, Alexander Bolodurin wrote:
>
> On 02/10/2011, at 9:38 PM, Tobias Grosser wrote:
> I may have omitted one crucial detail: I run 2.9 release.
> I've run your test case with 2.9 and svn build and I do indeed get timing comparable to yours.
>
> -------------------8<-------------------
> Parsing boost.cc:   1.3869 (100.0%)   0.2169 (100.0%)   1.6038 (100.0%)   1.6073 (100.0%)
> Precompiling preamble:   2.1251 (100.0%)   0.4021 (100.0%)   2.5273 (100.0%)   2.7308 (100.0%)
> Cache global code completions for boost.cc:   0.4364 (100.0%)   0.0050 (100.0%)   0.4413 (100.0%)   0.4414 (100.0%)
> Reparsing boost.cc:   2.6944 (100.0%)   0.5080 (100.0%)   3.2024 (100.0%)   3.4065 (100.0%)
> Code completion @ boost.cc:16:10:   0.1284 (100.0%)   0.0418 (100.0%)   0.1702 (100.0%)   0.1703 (100.0%)
> -------------------8<-------------------
> Parsing boost.cc:   1.4944 (100.0%)   0.1213 (100.0%)   1.6157 (100.0%)   1.6160 (100.0%)
> Precompiling preamble:   2.0441 (100.0%)   0.2648 (100.0%)   2.3089 (100.0%)   2.3872 (100.0%)
> Cache global code completions for boost.cc:   0.5091 (100.0%)   0.0047 (100.0%)   0.5138 (100.0%)   0.5138 (100.0%)
> Reparsing boost.cc:   2.6945 (100.0%)   0.3137 (100.0%)   3.0082 (100.0%)   3.0866 (100.0%)
> Code completion @ boost.cc:16:10:   0.1372 (100.0%)   0.0275 (100.0%)   0.1647 (100.0%)   0.1651 (100.0%)
> -------------------8<-------------------

Great. You seem to have a machine that is even faster than mine.

> However... for my original test case, I get almost 4x speedup!
>
> -------------------8<-------------------
> Parsing f.cc:   2.9795 (100.0%)   0.5403 (100.0%)   3.5199 (100.0%)   3.5210 (100.0%)
> Precompiling preamble:   4.6721 (100.0%)   1.0640 (100.0%)   5.7361 (100.0%)   6.4709 (100.0%)
> Cache global code completions for f.cc:   1.0227 (100.0%)   0.0065 (100.0%)   1.0292 (100.0%)   1.0324 (100.0%)
> Reparsing f.cc:   6.2431 (100.0%)   1.3625 (100.0%)   7.6056 (100.0%)   8.3611 (100.0%)
> Code completion @ f.cc:6:8:   2.0723 (100.0%)   0.4668 (100.0%)   2.5391 (100.0%)   2.5500 (100.0%)
> -------------------8<-------------------
> Parsing f.cc:   3.2017 (100.0%)   0.2806 (100.0%)   3.4822 (100.0%)   3.4856 (100.0%)
> Precompiling preamble:   4.2331 (100.0%)   0.5612 (100.0%)   4.7942 (100.0%)   5.0883 (100.0%)
> Cache global code completions for f.cc:   1.2300 (100.0%)   0.0061 (100.0%)   1.2362 (100.0%)   1.2362 (100.0%)
> Reparsing f.cc:   6.0510 (100.0%)   0.7061 (100.0%)   6.7571 (100.0%)   7.0513 (100.0%)
> Code completion @ f.cc:6:8:   0.6013 (100.0%)   0.0895 (100.0%)   0.6908 (100.0%)   0.6909 (100.0%)
> -------------------8<-------------------
>
> So, I guess I'll just have to use the svn build until the next Clang release.

Still quiet a long time, but a lot faster than before. Do you think this 
works for you or do you plan to look into further possibilities for speedup.

> There is still overhead in clang_complete itself, but that's not clang's problem.

Yes, as soon as the number of completion results is large clang_complete 
becomes notably slower. If you plan to look into this I am glad to help 
you here.

Cheers
Tobi



More information about the cfe-dev mailing list