浏览代码

Give a hint that we are sequentially reading memory

At least on FreeBSD this lowered page faults from 92 to 84
Bryan Drewery 12 年之前
父节点
当前提交
c59ea4b3d6
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      src/binary.c

+ 1 - 0
src/binary.c

@@ -176,6 +176,7 @@ bin_checksum(const char *fname, int todo)
       PREFIXLEN)) == 0) {
     goto fatal;
   }
+  madvise(map, size, MADV_SEQUENTIAL);
   MD5_Update(&ctx, map, offset);
 
   /* Hash everything after the packdata too */