[cfe-commits] r48991 - /cfe/trunk/lib/Basic/SourceManager.cpp

Steve Naroff snaroff at apple.com
Mon Mar 31 11:44:59 PDT 2008


Author: snaroff
Date: Mon Mar 31 13:44:59 2008
New Revision: 48991

URL: http://llvm.org/viewvc/llvm-project?rev=48991&view=rev
Log:
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.

Modified:
    cfe/trunk/lib/Basic/SourceManager.cpp

Modified: cfe/trunk/lib/Basic/SourceManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/SourceManager.cpp?rev=48991&r1=48990&r2=48991&view=diff

==============================================================================
--- cfe/trunk/lib/Basic/SourceManager.cpp (original)
+++ cfe/trunk/lib/Basic/SourceManager.cpp Mon Mar 31 13:44:59 2008
@@ -51,7 +51,7 @@
 #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());
   





More information about the cfe-commits mailing list