diff options
author | Nicolas Pitre <nico@fluxnic.net> | 2010-02-20 23:27:31 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-02-21 11:36:23 -0800 |
commit | 9892bebafe0865d8f4f3f18d60a1cfa2d1447cd7 (patch) | |
tree | b6f46ee135586730aa35f0d31b9f8a679f4bb93d /t/t4029-diff-trailing-space.sh | |
parent | Git 1.7.0 (diff) | |
download | tgif-9892bebafe0865d8f4f3f18d60a1cfa2d1447cd7.tar.xz |
sha1_file: don't malloc the whole compressed result when writing out objects
There is no real advantage to malloc the whole output buffer and
deflate the data in a single pass when writing loose objects. That is
like only 1% faster while using more memory, especially with large
files where memory usage is far more. It is best to deflate and write
the data out in small chunks reusing the same memory instead.
For example, using 'git add' on a few large files averaging 40 MB ...
Before:
21.45user 1.10system 0:22.57elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+828040outputs (0major+142640minor)pagefaults 0swaps
After:
21.50user 1.25system 0:22.76elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+828040outputs (0major+104408minor)pagefaults 0swaps
While the runtime stayed relatively the same, the number of minor page
faults went down significantly.
Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4029-diff-trailing-space.sh')
0 files changed, 0 insertions, 0 deletions