From: Jonathan Nieder <jrnieder@gmail.com>
To: Shawn Pearce <spearce@spearce.org>
Cc: weigelt@metux.de, git@vger.kernel.org
Subject: Re: large files and low memory
Date: Mon, 4 Oct 2010 13:58:54 -0500 [thread overview]
Message-ID: <20101004185854.GA6466@burratino> (raw)
In-Reply-To: <AANLkTimbdrAqoWMxiteT5zNYmwHp8M698BEv1FLuiAxx@mail.gmail.com>
Shawn Pearce wrote:
> The mmap() isn't the problem. Its the allocation of a buffer that is
> larger than the file in order to hold the result of deflating the file
> before it gets written to disk.
Wasn't this already fixed, at least in some cases?
commit 9892bebafe0865d8f4f3f18d60a1cfa2d1447cd7 (tags/v1.7.0.2~11^2~1)
Author: Nicolas Pitre <nico@fluxnic.net>
Date: Sat Feb 20 23:27:31 2010 -0500
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>
next prev parent reply other threads:[~2010-10-04 19:02 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-04 9:20 large files and low memory Enrico Weigelt
2010-10-04 18:05 ` Shawn Pearce
2010-10-04 18:24 ` Joshua Jensen
2010-10-04 18:57 ` Shawn Pearce
2010-10-05 0:59 ` Enrico Weigelt
2010-10-05 7:41 ` Enrico Weigelt
2010-10-05 8:01 ` Matthieu Moy
2010-10-05 8:17 ` Enrico Weigelt
2010-10-05 11:29 ` Alex Riesen
2010-10-05 11:38 ` Matthieu Moy
2010-10-05 11:55 ` Nguyen Thai Ngoc Duy
2010-10-05 16:42 ` Junio C Hamano
2010-10-05 10:13 ` Nguyen Thai Ngoc Duy
2010-10-05 19:12 ` Nicolas Pitre
2010-10-04 18:58 ` Jonathan Nieder [this message]
2010-10-04 19:11 ` Shawn Pearce
2010-10-04 19:16 ` Jonathan Nieder
2010-10-05 10:59 ` Nguyen Thai Ngoc Duy
2010-10-05 20:17 ` Nicolas Pitre
2010-10-05 20:34 ` Jonathan Nieder
2010-10-05 21:11 ` Nicolas Pitre
2010-10-05 0:57 ` Enrico Weigelt
2010-10-05 1:07 ` Ævar Arnfjörð Bjarmason
2010-10-05 1:10 ` Jonathan Nieder
2010-10-05 7:35 ` Enrico Weigelt
2010-10-05 13:47 ` Jonathan Nieder
2010-10-05 0:50 ` Enrico Weigelt
2010-10-05 19:06 ` Nicolas Pitre
2010-10-05 22:51 ` Enrico Weigelt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101004185854.GA6466@burratino \
--to=jrnieder@gmail.com \
--cc=git@vger.kernel.org \
--cc=spearce@spearce.org \
--cc=weigelt@metux.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).