hash-object: don't use mmap() for small files
commitea68b0ce9f8ce8da3e360aed3cbd6720159ffbee
authorDmitry Potapov <dpotapov@gmail.com>
Sun, 21 Feb 2010 06:32:19 +0000 (21 09:32 +0300)
committerJunio C Hamano <gitster@pobox.com>
Sun, 21 Feb 2010 19:39:10 +0000 (21 11:39 -0800)
tree0b2e4380a4bcd4933c0f85440c033def07fc090a
parente923eaeb901ff056421b9007adcbbce271caa7b6
hash-object: don't use mmap() for small files

Using read() instead of mmap() can be 39% speed up for 1Kb files and is
1% speed up 1Mb files. For larger files, it is better to use mmap(),
because the difference between is not significant, and when there is not
enough memory, mmap() performs much better, because it avoids swapping.

Signed-off-by: Dmitry Potapov <dpotapov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sha1_file.c