author | Dmitry Potapov <dpotapov@gmail.com> | |
Sun, 21 Feb 2010 06:32:19 +0000 (09:32 +0300) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 21 Feb 2010 19:39:10 +0000 (11:39 -0800) | ||
commit | ea68b0ce9f8ce8da3e360aed3cbd6720159ffbee | |
tree | 0b2e4380a4bcd4933c0f85440c033def07fc090a | tree | snapshot |
parent | e923eaeb901ff056421b9007adcbbce271caa7b6 | commit | diff |
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>
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 | diff | blob | history |