From: "Geoffrey Irving" <irving@naml.us>
To: "Johannes Schindelin" <Johannes.Schindelin@gmx.de>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: [PATCH] Adding a cache of commit to patch-id pairs to speed up git-cherry
Date: Mon, 2 Jun 2008 10:23:55 -0700 [thread overview]
Message-ID: <7f9d599f0806021023r64affb36ne491792a962d455c@mail.gmail.com> (raw)
In-Reply-To: <7f9d599f0806020750g78e6816dl884d36bb903c707b@mail.gmail.com>
On Mon, Jun 2, 2008 at 7:50 AM, Geoffrey Irving <irving@naml.us> wrote:
> On Sun, Jun 1, 2008 at 11:13 PM, Johannes Schindelin
> <Johannes.Schindelin@gmx.de> wrote:
>> Hi,
>>
>> On Sun, 1 Jun 2008, Geoffrey Irving wrote:
>>
>>> The dominant cost of git-cherry is the computation of patch-ids for each
>>> relevant commit. Once computed, these pairs are now stored in a hash
>>> table in $GIT_DIR/patch-id-cache to speed up repeated invocations.
>>>
>>> The basic structure of patch-id-cache.c was cannibalized from Johannes
>>> Schindelin's notes-index structure, though most of the code was
>>> rewritten. The hash table is still kept strictly sorted by commit, but
>>> the entire table is now read into memory.
>>
>> I do not think that this "read-the-entire-table-into-memory" paradigm is a
>> wise choice. mmap()ing, I would have understood, but reading a potentially
>> pretty large table into memory?
>
> I'll switch to mmapping.
The git_mmap function in compat/mmap.c dies if NO_MMAP is defined and
the map isn't MAP_PRIVATE. If I want to write an entry, will the
memory be automatically updated if I write directly to the file
descriptor (I haven't used mmap before)?
Also, do you think it's okay to write directly into the mmap'ed memory
for every insertion, or should I try to be fancier? Immediate writing
would simplify the code a lot, and I don't think there's a significant
performance issue since computing an entry is expensive.
Thanks,
Geoffrey
next prev parent reply other threads:[~2008-06-02 17:24 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-02 3:54 [PATCH] Adding a cache of commit to patch-id pairs to speed up git-cherry Geoffrey Irving
2008-06-02 6:13 ` Johannes Schindelin
2008-06-02 6:42 ` Jeff King
2008-06-02 14:35 ` Geoffrey Irving
2008-06-02 15:37 ` Johannes Schindelin
2008-06-02 15:49 ` Geoffrey Irving
2008-06-02 15:56 ` Shawn O. Pearce
2008-06-02 16:18 ` Johannes Schindelin
2008-06-02 16:26 ` Geoffrey Irving
2008-06-02 18:15 ` Johannes Schindelin
2008-06-07 23:50 ` Geoffrey Irving
2008-06-08 16:10 ` Johannes Schindelin
2008-06-02 14:50 ` Geoffrey Irving
2008-06-02 15:52 ` Johannes Schindelin
2008-06-02 17:23 ` Geoffrey Irving [this message]
2008-06-02 18:22 ` Johannes Schindelin
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=7f9d599f0806021023r64affb36ne491792a962d455c@mail.gmail.com \
--to=irving@naml.us \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
/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