[cfe-commits] r116797 - /cfe/trunk/include/clang/AST/DeclBase.h

Francois Pichet pichet2000 at gmail.com
Mon Oct 18 23:36:28 PDT 2010


On Tue, Oct 19, 2010 at 1:43 AM, John McCall <rjmccall at apple.com> wrote:
> Author: rjmccall
> Date: Tue Oct 19 00:43:52 2010
> New Revision: 116797
>
> URL: http://llvm.org/viewvc/llvm-project?rev=116797&view=rev
> Log:
> MSVC space optimization.

Some profiling stat from parsing MSVC headers file (non template one)
using -print-stats

Before r116797
  Number of memory regions: 602
  Bytes used: 59916200
  Bytes allocated: 64008192
  Bytes wasted: 4091992 (includes alignment, etc)
After r116797
  Number of memory regions: 589
  Bytes used: 52392504
  Bytes allocated: 56340480
  Bytes wasted: 3947976 (includes alignment, etc)

Full details in files attached.
-------------- next part --------------

Number of memory regions: 589
Bytes used: 52392504
Bytes allocated: 56340480
Bytes wasted: 3947976 (includes alignment, etc)

STATISTICS:
*** AST Context Stats:
  205475 types total.
    28 Builtin types
    3 Complex types
    30480 Pointer types
    12486 LValueReference types
    1499 ConstantArray types
    344 IncompleteArray types
    167 VariableArray types
    86 DependentSizedArray types
    104443 FunctionProto types
    1 FunctionNoProto types
    16361 Typedef types
    16372 Record types
    4468 Enum types
    18620 Elaborated types
    7 TemplateTypeParm types
    4 SubstTemplateTypeParm types
    94 TemplateSpecialization types
    3 InjectedClassName types
    9 DependentName types
Total bytes = 4904296
  105/14119 implicit default constructors created
  113/14181 implicit copy constructors created
  5996/14184 implicit copy assignment operators created
  5909/14156 implicit destructors created
*** Decl Stats:
  414006 decls total.
    5484 AccessSpec decls, 24 each (131616 bytes)
    61 Friend decls, 36 each (2196 bytes)
    17827 LinkageSpec decls, 44 each (784388 bytes)
    7 Namespace decls, 60 each (420 bytes)
    3 ClassTemplate decls, 36 each (108 bytes)
    81 FunctionTemplate decls, 36 each (2916 bytes)
    4468 Enum decls, 88 each (393184 bytes)
    36500 CXXRecord decls, 88 each (3212000 bytes)
    10 ClassTemplateSpecialization decls, 124 each (1240 bytes)
    12 TemplateTypeParm decls, 36 each (432 bytes)
    29402 Typedef decls, 36 each (1058472 bytes)
    41162 Field decls, 40 each (1646480 bytes)
    21560 Function decls, 88 each (1897280 bytes)
    45587 CXXMethod decls, 88 each (4011656 bytes)
    572 CXXConstructor decls, 104 each (59488 bytes)
    32 CXXConversion decls, 96 each (3072 bytes)
    5976 CXXDestructor decls, 96 each (573696 bytes)
    20415 Var decls, 48 each (979920 bytes)
    82 NonTypeTemplateParm decls, 60 each (4920 bytes)
    151182 ParmVar decls, 56 each (8466192 bytes)
    33583 EnumConstant decls, 56 each (1880648 bytes)
Total bytes = 25110324
*** Stmt/Expr Stats:
  307793 stmts/exprs total.
    5 AsmStmt, 52 each (260 bytes)
    88 BreakStmt, 12 each (1056 bytes)
    3892 CompoundStmt, 24 each (93408 bytes)
    983 DeclStmt, 20 each (19660 bytes)
    8 DoStmt, 28 each (224 bytes)
    180 ArraySubscriptExpr, 32 each (5760 bytes)
    14612 BinaryOperator, 36 each (526032 bytes)
    243 CompoundAssignOperator, 44 each (10692 bytes)
    3 CXXBindTemporaryExpr, 28 each (84 bytes)
    38 CXXBoolLiteralExpr, 28 each (1064 bytes)
    462 CXXConstructExpr, 44 each (20328 bytes)
    19 CXXTemporaryObjectExpr, 52 each (988 bytes)
    12 CXXDefaultArgExpr, 28 each (336 bytes)
    13 CXXDeleteExpr, 36 each (468 bytes)
    45 CXXDependentScopeMemberExpr, 68 each (3060 bytes)
    3 CXXExprWithTemporaries, 32 each (96 bytes)
    47 CXXNewExpr, 64 each (3008 bytes)
    4 CXXNullPtrLiteralExpr, 24 each (96 bytes)
    2633 CXXThisExpr, 28 each (73724 bytes)
    1 CXXThrowExpr, 28 each (28 bytes)
    18 CXXUuidofExpr, 32 each (576 bytes)
    1552 CallExpr, 32 each (49664 bytes)
    1087 CXXMemberCallExpr, 32 each (34784 bytes)
    61 CXXOperatorCallExpr, 36 each (2196 bytes)
    4371 CStyleCastExpr, 40 each (174840 bytes)
    320 CXXFunctionalCastExpr, 40 each (12800 bytes)
    1 CXXConstCastExpr, 36 each (36 bytes)
    28 CXXReinterpretCastExpr, 36 each (1008 bytes)
    60 CXXStaticCastExpr, 36 each (2160 bytes)
    67016 ImplicitCastExpr, 28 each (1876448 bytes)
    366 CharacterLiteral, 32 each (11712 bytes)
    326 ConditionalOperator, 44 each (14344 bytes)
    19654 DeclRefExpr, 36 each (707544 bytes)
    154 FloatingLiteral, 48 each (7392 bytes)
    178 ImplicitValueInitExpr, 20 each (3560 bytes)
    21450 InitListExpr, 52 each (1115400 bytes)
    131022 IntegerLiteral, 48 each (6289056 bytes)
    4811 MemberExpr, 44 each (211684 bytes)
    613 UnresolvedLookupExpr, 68 each (41684 bytes)
    153 UnresolvedMemberExpr, 76 each (11628 bytes)
    15788 ParenExpr, 32 each (505216 bytes)
    24 ParenListExpr, 36 each (864 bytes)
    590 SizeOfAlignOfExpr, 36 each (21240 bytes)
    9150 StringLiteral, 40 each (366000 bytes)
    2265 UnaryOperator, 32 each (72480 bytes)
    17 ForStmt, 40 each (680 bytes)

STATISTICS FOR 'compile_test.cpp':

*** Preprocessor Stats:
186965 directives found:
  110317 #define.
  1088 #undef.
  #include/#include_next/#import:
    1501 source files entered.
    8 max include stack depth
  36516 #if/#ifndef/#ifdef.
  7414 #else/#elif.
  25253 #endif.
  2558 #pragma.
14244 #if/#ifndef#ifdef regions skipped
292792/92086/0 obj/fn/builtin macros expanded, 173644 on the fast path.
46876 token paste (##) operations performed, 43173 on the fast path.

Number of memory regions: 437
Bytes used: 13049771
Bytes allocated: 13590528
Bytes wasted: 540757 (includes alignment, etc)

*** Source Manager Stats:
1197 files mapped, 279 mem buffers mapped.
1024216 SLocEntry's allocated, 80097561B of Sloc address space used.
67937176 bytes of files mapped, 7 files with line #'s computed.
FileID scans: 3589 linear, 2391823 binary.

1 error generated.

*** File Manager Stats:
1197 files found, 6 dirs found.
2686 dir lookups, 10 dir cache misses.
5035 file lookups, 2679 file cache misses.

    956 IfStmt, 32 each (30592 bytes)
    10 NullStmt, 12 each (120 bytes)
    2351 ReturnStmt, 20 each (47020 bytes)
    68 CaseStmt, 36 each (2448 bytes)
    17 DefaultStmt, 24 each (408 bytes)
    17 SwitchStmt, 32 each (544 bytes)
    8 WhileStmt, 24 each (192 bytes)
Total bytes = 12376692

*** Identifier Table Stats:
# Identifiers:   286247
# Empty Buckets: 238041
Hash density (#identifiers per bucket): 0.545973
Ave identifier length: 20.589197
Max identifier length: 92

*** HeaderSearch Stats:
1197 files tracked.
  746 #import/#pragma once files.
  1156 included exactly once.
  117 max times a file is included.
  3831 #include/#include_next/#import.
    179 #includes skipped due to the multi-include optimization.
0 framework lookups.
0 subframework lookups.
-------------- next part --------------

Number of memory regions: 602
Bytes used: 59916200
Bytes allocated: 64008192
Bytes wasted: 4091992 (includes alignment, etc)

STATISTICS:
*** AST Context Stats:
  205475 types total.
    28 Builtin types
    3 Complex types
    30480 Pointer types
    12486 LValueReference types
    1499 ConstantArray types
    344 IncompleteArray types
    167 VariableArray types
    86 DependentSizedArray types
    104443 FunctionProto types
    1 FunctionNoProto types
    16361 Typedef types
    16372 Record types
    4468 Enum types
    18620 Elaborated types
    7 TemplateTypeParm types
    4 SubstTemplateTypeParm types
    94 TemplateSpecialization types
    3 InjectedClassName types
    9 DependentName types
Total bytes = 4978812
  105/14119 implicit default constructors created
  113/14181 implicit copy constructors created
  5996/14184 implicit copy assignment operators created
  5909/14156 implicit destructors created
*** Decl Stats:
  414006 decls total.
    5484 AccessSpec decls, 40 each (219360 bytes)
    61 Friend decls, 52 each (3172 bytes)
    17827 LinkageSpec decls, 64 each (1140928 bytes)
    7 Namespace decls, 80 each (560 bytes)
    3 ClassTemplate decls, 52 each (156 bytes)
    81 FunctionTemplate decls, 52 each (4212 bytes)
    4468 Enum decls, 108 each (482544 bytes)
    36500 CXXRecord decls, 108 each (3942000 bytes)
    10 ClassTemplateSpecialization decls, 144 each (1440 bytes)
    12 TemplateTypeParm decls, 52 each (624 bytes)
    29402 Typedef decls, 52 each (1528904 bytes)
    41162 Field decls, 56 each (2305072 bytes)
    21560 Function decls, 112 each (2414720 bytes)
    45587 CXXMethod decls, 112 each (5105744 bytes)
    572 CXXConstructor decls, 128 each (73216 bytes)
    32 CXXConversion decls, 120 each (3840 bytes)
    5976 CXXDestructor decls, 120 each (717120 bytes)
    20415 Var decls, 64 each (1306560 bytes)
    82 NonTypeTemplateParm decls, 76 each (6232 bytes)
    151182 ParmVar decls, 72 each (10885104 bytes)
    33583 EnumConstant decls, 72 each (2417976 bytes)
Total bytes = 32559484
*** Stmt/Expr Stats:
  307793 stmts/exprs total.
    5 AsmStmt, 52 each (260 bytes)
    88 BreakStmt, 12 each (1056 bytes)
    3892 CompoundStmt, 24 each (93408 bytes)
    983 DeclStmt, 20 each (19660 bytes)
    8 DoStmt, 28 each (224 bytes)
    180 ArraySubscriptExpr, 32 each (5760 bytes)
    14612 BinaryOperator, 36 each (526032 bytes)
    243 CompoundAssignOperator, 44 each (10692 bytes)
    3 CXXBindTemporaryExpr, 28 each (84 bytes)
    38 CXXBoolLiteralExpr, 28 each (1064 bytes)
    462 CXXConstructExpr, 44 each (20328 bytes)
    19 CXXTemporaryObjectExpr, 52 each (988 bytes)
    12 CXXDefaultArgExpr, 28 each (336 bytes)
    13 CXXDeleteExpr, 36 each (468 bytes)
    45 CXXDependentScopeMemberExpr, 68 each (3060 bytes)
    3 CXXExprWithTemporaries, 32 each (96 bytes)
    47 CXXNewExpr, 64 each (3008 bytes)
    4 CXXNullPtrLiteralExpr, 24 each (96 bytes)
    2633 CXXThisExpr, 28 each (73724 bytes)
    1 CXXThrowExpr, 28 each (28 bytes)
    18 CXXUuidofExpr, 32 each (576 bytes)
    1552 CallExpr, 32 each (49664 bytes)
    1087 CXXMemberCallExpr, 32 each (34784 bytes)
    61 CXXOperatorCallExpr, 36 each (2196 bytes)
    4371 CStyleCastExpr, 40 each (174840 bytes)
    320 CXXFunctionalCastExpr, 40 each (12800 bytes)
    1 CXXConstCastExpr, 36 each (36 bytes)
    28 CXXReinterpretCastExpr, 36 each (1008 bytes)
    60 CXXStaticCastExpr, 36 each (2160 bytes)
    67016 ImplicitCastExpr, 28 each (1876448 bytes)
    366 CharacterLiteral, 32 each (11712 bytes)
    326 ConditionalOperator, 44 each (14344 bytes)
    19654 DeclRefExpr, 36 each (707544 bytes)
    154 FloatingLiteral, 48 each (7392 bytes)
    178 ImplicitValueInitExpr, 20 each (3560 bytes)
    21450 InitListExpr, 52 each (1115400 bytes)
    131022 IntegerLiteral, 48 each (6289056 bytes)
    4811 MemberExpr, 44 each (211684 bytes)
    613 UnresolvedLookupExpr, 68 each (41684 bytes)
    153 UnresolvedMemberExpr, 76 each (11628 bytes)
    15788 ParenExpr, 32 each (505216 bytes)
    24 ParenListExpr, 36 each (864 bytes)
    590 SizeOfAlignOfExpr, 36 each (21240 bytes)
    9150 StringLiteral, 40 each (366000 bytes)
    2265 UnaryOperator, 32 each (72480 bytes)
    17 ForStmt, 40 each (680 bytes)

STATISTICS FOR 'compile_test.cpp':

*** Preprocessor Stats:
186965 directives found:
  110317 #define.
  1088 #undef.
  #include/#include_next/#import:
    1501 source files entered.
    8 max include stack depth
  36516 #if/#ifndef/#ifdef.
  7414 #else/#elif.
  25253 #endif.
  2558 #pragma.
14244 #if/#ifndef#ifdef regions skipped
292792/92086/0 obj/fn/builtin macros expanded, 173644 on the fast path.
46876 token paste (##) operations performed, 43173 on the fast path.

Number of memory regions: 437
Bytes used: 13049771
Bytes allocated: 13590528
Bytes wasted: 540757 (includes alignment, etc)

*** Source Manager Stats:
1197 files mapped, 279 mem buffers mapped.
1024216 SLocEntry's allocated, 80097561B of Sloc address space used.
67937176 bytes of files mapped, 7 files with line #'s computed.
FileID scans: 3589 linear, 2391823 binary.

1 error generated.

*** File Manager Stats:
1197 files found, 6 dirs found.
2686 dir lookups, 10 dir cache misses.
5035 file lookups, 2679 file cache misses.

    956 IfStmt, 32 each (30592 bytes)
    10 NullStmt, 12 each (120 bytes)
    2351 ReturnStmt, 20 each (47020 bytes)
    68 CaseStmt, 36 each (2448 bytes)
    17 DefaultStmt, 24 each (408 bytes)
    17 SwitchStmt, 32 each (544 bytes)
    8 WhileStmt, 24 each (192 bytes)
Total bytes = 12376692

*** Identifier Table Stats:
# Identifiers:   286247
# Empty Buckets: 238041
Hash density (#identifiers per bucket): 0.545973
Ave identifier length: 20.589197
Max identifier length: 92

*** HeaderSearch Stats:
1197 files tracked.
  746 #import/#pragma once files.
  1156 included exactly once.
  117 max times a file is included.
  3831 #include/#include_next/#import.
    179 #includes skipped due to the multi-include optimization.
0 framework lookups.
0 subframework lookups.


More information about the cfe-commits mailing list