diff options
author | Chris Lattner <sabre@nondot.org> | 2010-11-23 22:32:37 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-11-23 22:32:37 +0000 |
commit | 5cc1c738b0c51af55cbfe7672c284c19f8e30eb2 (patch) | |
tree | 2746d25a62487e5c74b74d6ba619a3d8016b87d2 /include/clang/Basic/FileManager.h | |
parent | fe4ea55700c806493bebbf7bbfe07ce4b7339a3e (diff) |
The final result of all this refactoring: instead of doing stat immediately
followed by an open for every source file we open, probe the file system with
'open' and then do an fstat when it succeeds. open+fstat is faster than
stat+open because the kernel only has to perform the string->inode mapping
once. Presumably it gets faster the deeper in your filesystem a lookup
happens.
For -Eonly on cocoa.h, this reduces system time from 0.042s to 0.039s on
my machine, a 7.7% speedup.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120066 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/FileManager.h')
-rw-r--r-- | include/clang/Basic/FileManager.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/clang/Basic/FileManager.h b/include/clang/Basic/FileManager.h index a32f65a598..cbe3cde65a 100644 --- a/include/clang/Basic/FileManager.h +++ b/include/clang/Basic/FileManager.h @@ -61,7 +61,7 @@ class FileEntry { /// FD - The file descriptor for the file entry if it is opened and owned /// by the FileEntry. If not, this is set to -1. - int FD; + mutable int FD; friend class FileManager; void operator=(const FileEntry&); // DO NOT IMPLEMENT. |