diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-01-06 22:43:04 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-01-06 22:43:04 +0000 |
commit | 5b034ad3ec0aa1ad6bcb3624390f030038670705 (patch) | |
tree | fa288ec43e8ed83aeb2100ccf0c67a3721459d73 /lib/Sema/SemaType.cpp | |
parent | b789103464f55639384cb468e7ed90a8268c84f4 (diff) |
SourceManager: Implement "lazy" creation of MemBuffers for source files.
- Big Idea:
Source files are now mmaped when ContentCache::getBuffer() is first called.
While this doesn't change the functionality when lexing regular source files,
it can result in source files not being paged in when using PTH.
- Performance change:
- No observable difference (-fsyntax-only/-Eonly) on Cocoa.h when doing
regular source lexing.
- No observable time difference (-fsyntax-only/-Eonly) on Cocoa.h when using
PTH. We do observe, however, a reduction of 279K in memory mapped source
code (3% reduction). The majority of pages from Cocoa.h (and friends) are
still being pulled in, however, because any literal will cause
Preprocessor::getSpelling() to be called (causing the source for the file to
get pulled in). The next possible optimization is to cache literal strings
in the PTH file to avoid the need for the original header sources entirely.
- Right now there is a preprocessor directive to toggle between "lazy" and
"eager" creation of MemBuffers. This is not permanent, and is there in the
short term to just test additional optimizations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61827 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaType.cpp')
0 files changed, 0 insertions, 0 deletions