From: "Marco Costalba" <mcostalba@gmail.com>
To: "Junio C Hamano" <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH RESEND] Avoid a useless prefix lookup in strbuf_expand()
Date: Tue, 5 Feb 2008 14:17:26 +0100 [thread overview]
Message-ID: <e5bfff550802050517o3f4f5f61n8ed6ab2bce57d25f@mail.gmail.com> (raw)
In-Reply-To: <7vtzknga5g.fsf@gitster.siamese.dyndns.org>
On Feb 5, 2008 8:00 AM, Junio C Hamano <gitster@pobox.com> wrote:
>
> Another thing I noticed is that --pretty='format:%an %ae %at'
> would end up running this function three times. Perhaps it is
> worth memoizing the result in format_commit_context while you
> are at it?
>
Yes, I tought about this. But at the end I rejected this idea to keep
the code simple and because the optimization was in any case small
(and also in a special cases only).
I did some profiling with and without my patch and I noticed a nice
improvement so that with the patch applied git-rev-list and git-log
--pretty=format have almost the same execution times.
This is because the biggest time in both cases is spent in zlib
decompress, so also a local further speed up of format_person_part()
does not gain anything but complicates the code.
Marco
P.S: I will try to adress your concerns on the naming of end_of_data
flag (hints are welcomed, I'm bad at naming) and on the skipping
further elaborations if end_of_data is true to have cleaner code, I
was thinking about using 'goto xxxx' or something like that.
prev parent reply other threads:[~2008-02-05 13:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-02 11:09 [PATCH RESEND] Avoid a useless prefix lookup in strbuf_expand() Marco Costalba
2008-02-03 21:53 ` Junio C Hamano
2008-02-03 22:22 ` Marco Costalba
2008-02-05 7:00 ` Junio C Hamano
2008-02-05 13:17 ` Marco Costalba [this message]
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=e5bfff550802050517o3f4f5f61n8ed6ab2bce57d25f@mail.gmail.com \
--to=mcostalba@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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).