Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] Performance problems building C++ ASTs

I think you can get a reference to the IIndex using CCorePlugin.getIndexManager().getIndex(tu.getCProject()).
Then call getAST() with the option ITranslationUnit.AST_SKIP_ALL_HEADERS.

This will cause the preprocessor to ignore #include directives, which is a huge performance boost. Bindings and macro calls will be resolved using the index when necessary.

I don't know if the OpenMP analysis code depends on a full parse though.

But it seems strange that parsing would be so much faster for C than C++. Are you calling the parser exactly the same way in both cases? I can see that the current code uses the CDOM.

Is CDOM something that is supposed to be deprecated eventually? Should we do it for 5.0?


Mike Kucera
Software Developer
IBM Eclipse CDT Team
mkucera@xxxxxxxxxx



Inactive hide details for Beth Tibbitts ---05/21/2008 01:14:28 PM---So how do I improve this? Can you provide some suggestions?Beth Tibbitts ---05/21/2008 01:14:28 PM---So how do I improve this? Can you provide some suggestions?

          Beth Tibbitts <tibbitts@xxxxxxxxxx>
          Sent by: cdt-dev-bounces@xxxxxxxxxxx

          05/21/2008 01:13 PM

          Please respond to
          "CDT General developers list." <cdt-dev@xxxxxxxxxxx>

To

"CDT General developers list." <cdt-dev@xxxxxxxxxxx>

cc


Subject

RE: [cdt-dev] Performance problems building C++ ASTs

So how do I improve this? Can you provide some suggestions?

...Beth

Beth Tibbitts (859) 243-4981 (TL 545-4981)
High Productivity Tools / Parallel Tools
http://eclipse.org/ptp
IBM T.J.Watson Research Center
Mailing Address: IBM Corp., 745 West New Circle Road, Lexington, KY 40511
Inactive hide details for "Schorn, Markus" <Markus.Schorn@xxxxxxxxxxxxx>"Schorn, Markus" <Markus.Schorn@xxxxxxxxxxxxx>

                  "Schorn, Markus" <Markus.Schorn@xxxxxxxxxxxxx>
                  Sent by: cdt-dev-bounces@xxxxxxxxxxx

                  05/21/08 01:00 PM

Please respond to
"CDT General developers list." <cdt-dev@xxxxxxxxxxx>
To

"CDT General developers list." <cdt-dev@xxxxxxxxxxx>
cc
Subject

RE: [cdt-dev] Performance problems building C++ ASTs

The speed depends on the options you use with IASTTranslationUnit.getAST(...). If you are not using an index, parsing an entire project will be too slow.
Markus.



From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Beth Tibbitts
Sent:
Wednesday, May 21, 2008 5:01 PM
To:
cdt-dev@xxxxxxxxxxx
Subject:
[cdt-dev] Performance problems building C++ ASTs
Importance:
Low

I'm tracking down a performance problem (CDT 4.0.3 for now) running our PTP analysis tools on C++ code.
Getting the IASTTranslationUnit from the ITranslationUnit seems to be the culprit.
For C code,

IASTTranslationUnit atu = itranslationunit.getAST();
takes a few hundredths of a sec

For a C++ file, it takes on the order of a second and a half.

Any idea how I can speed this up? Analyzing a large C++ project is impossible at this rate.
Most of our initial analysis was on plain C code and it seems to pose no large problems.



...Beth

Beth Tibbitts (859) 243-4981 (TL 545-4981)
High Productivity Tools / Parallel Tools
http://eclipse.org/ptp
IBM T.J.Watson Research Center
Mailing Address: IBM Corp., 745 West New Circle Road, Lexington, KY 40511
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx

https://dev.eclipse.org/mailman/listinfo/cdt-dev(See attached file: pic05758.gif)_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev

GIF image

GIF image

GIF image

GIF image

GIF image

Attachment: pic05758.gif
Description: GIF image


Back to the top