فهرست منبع

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 */