diff options
author | Steve Naroff <snaroff@apple.com> | 2008-03-31 18:44:59 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2008-03-31 18:44:59 +0000 |
commit | 93eea6e1a00c8409a9dfaf72c0494b3a00be4ee8 (patch) | |
tree | 0d5242a31e23b813ba49dd966380c08730a7788a /clang/lib/Basic/SourceManager.cpp | |
parent | bb7f03f9262464d8b5edeb6ea80b88cd4a051bb3 (diff) | |
download | bcm5719-llvm-93eea6e1a00c8409a9dfaf72c0494b3a00be4ee8.tar.gz bcm5719-llvm-93eea6e1a00c8409a9dfaf72c0494b3a00be4ee8.zip |
Hack ReadFileFast() to raise the threshold of memory mapped files (from 4->12 pages).
This is a temporary solution to avoid running out of file descriptors (which defaults to 256).
Need to benchmark to understand the speed benefit. If the benefit is small, the simple solution is to avoid memory mapping files. If the benefit is significant, more thought is necessary.
llvm-svn: 48991
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
-rw-r--r-- | clang/lib/Basic/SourceManager.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp index 73ac2abe26f..1141bed197d 100644 --- a/clang/lib/Basic/SourceManager.cpp +++ b/clang/lib/Basic/SourceManager.cpp @@ -51,7 +51,7 @@ static const MemoryBuffer *ReadFileFast(const FileEntry *FileEnt) { #endif // If the file is larger than some threshold, use 'read', otherwise use mmap. - if (FileEnt->getSize() >= 4096*4) + if (FileEnt->getSize() >= 4096*12) return MemoryBuffer::getFile(FileEnt->getName(), strlen(FileEnt->getName()), 0, FileEnt->getSize()); |