diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-02-11 00:52:17 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-02-11 00:52:17 +0000 |
commit | 005a6ace070c96e4d4c1186fadec591234b4ca8d (patch) | |
tree | 185376863406d82d0efda7b2f5c30313433f5a36 /clang/lib/Serialization/ASTWriter.cpp | |
parent | 4c898c239ebfdc535d316461eb59ed359e2a2d7a (diff) | |
download | bcm5719-llvm-005a6ace070c96e4d4c1186fadec591234b4ca8d.tar.gz bcm5719-llvm-005a6ace070c96e4d4c1186fadec591234b4ca8d.zip |
Eliminate a major performance problem with chained PCH, where we were
causing the deserialization of a large number of declarations when
writing the visible-updates record for the translation unit in C. This
takes us from:
*** AST File Statistics:
2 stat cache hits
6 stat cache misses
1/64463 source location entries read (0.001551%)
15606/16956 types read (92.038216%)
59266/89334 declarations read (66.342041%)
38952/61393 identifiers read (63.446976%)
0/7778 selectors read (0.000000%)
24192/34644 statements read (69.830276%)
388/8809 macros read (4.404586%)
2095/5189 lexical declcontexts read (40.373867%)
0/4587 visible declcontexts read (0.000000%)
0/7716 method pool entries read (0.000000%)
0 method pool misses
to
*** AST File Statistics:
2 stat cache hits
6 stat cache misses
1/64463 source location entries read (0.001551%)
26/16956 types read (0.153338%)
18/89334 declarations read (0.020149%)
145/61393 identifiers read (0.236183%)
0/7778 selectors read (0.000000%)
21/34644 statements read (0.060617%)
0/8809 macros read (0.000000%)
0/5189 lexical declcontexts read (0.000000%)
0/4587 visible declcontexts read (0.000000%)
0/7716 method pool entries read (0.000000%)
0 method pool misses
when generating a chained PCH for a header that #includes Cocoa.h
(from a PCH file) and adds one simple function declaration. The
generated PCH file is now only 9580 bytes (down from > 2MB).
llvm-svn: 125326
Diffstat (limited to 'clang/lib/Serialization/ASTWriter.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTWriter.cpp | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index ce686491428..f1af8354a24 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -2475,10 +2475,6 @@ uint64_t ASTWriter::WriteDeclContextVisibleBlock(ASTContext &Context, /// DeclContext in a dependent AST file. As such, they only exist for the TU /// (in C++) and for namespaces. void ASTWriter::WriteDeclContextVisibleUpdate(const DeclContext *DC) { - // Make the context build its lookup table, but don't make it load external - // decls. - DC->lookup(DeclarationName()); - StoredDeclsMap *Map = static_cast<StoredDeclsMap*>(DC->getLookupPtr()); if (!Map || Map->empty()) return; |