[cfe-dev] Is there a way to speed up parsing?

Zurab Btensnae zurabnbs at gmail.com
Wed Aug 7 09:31:13 PDT 2013


>
> Depending on exactly what information you want to extract, you may be
> able to set "SkipFunctionBodies". I found this cut the total parsing
> time down to 40%

Thanks for advice, but I already use option SkipFunctionBodies.

More generally, I think the consensus is that you have to do the
> indexing offline, and then have your IDE query the index.
>
> Have you seen this thread:
>
> http://clang-developers.42468.n3.nabble.com/RFC-A-proposal-for-a-Clang-based-service-architecture-td4024449.html
>
Thanks, I will read it, but it seems this article is not about performance
at all (anyway clang must index the whole project).


On Tue, Aug 6, 2013 at 9:38 PM, David Röthlisberger <david at rothlis.net>wrote:

> On 13-08-06 01:21 PM, Zurab Btensnae wrote:
> > I've tried to use libclang and, first of all, for test purposes I've
> indexed LLVM with it (using clang_indexSourceFile with empty callbacks).
> But the whole process takes about an hour, which is very slow. As far as I
> know libclang is used in some IDEs as a code assistance provider, but how
> it could be if it consumes so much time on relatively big projects? The
> project which I'd like to open is even bigger then LLVM (Mozilla). Is there
> a way to speed up parsing - for example to parse headers only once (create
> precompiled header for each parsed header), and then reuse this information
> in other translation units? Maybe this will lead to some inaccuracy because
> contexts are different, but performance is a showstopper for me :(. I'm
> ready to try to hack clang:) if somebody who is familiar with clang will
> give me a short briefing on how this could be done in principle (or maybe
> this is just impossible).
>
> Depending on exactly what information you want to extract, you may be
> able to set "SkipFunctionBodies". I found this cut the total parsing
> time down to 40% (see
> https://github.com/drothlis/clang-ctags/commit/ee7d93ee ).
>
> More generally, I think the consensus is that you have to do the
> indexing offline, and then have your IDE query the index.
>
> Have you seen this thread:
>
> http://clang-developers.42468.n3.nabble.com/RFC-A-proposal-for-a-Clang-based-service-architecture-td4024449.html
>
> Dave.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130807/463d7741/attachment.html>


More information about the cfe-dev mailing list