From: David Turner <dturner@twopensource.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Michael Haggerty <mhagger@alum.mit.edu>,
git@vger.kernel.org,
Christian Couder <christian.couder@gmail.com>
Subject: Re: [PATCH v5 2/3] path: optimize common dir checking
Date: Mon, 05 Oct 2015 16:10:10 -0400 [thread overview]
Message-ID: <1444075810.5158.7.camel@twopensource.com> (raw)
In-Reply-To: <xmqqd1wtz0w2.fsf@gitster.mtv.corp.google.com>
On Mon, 2015-10-05 at 10:22 -0700, Junio C Hamano wrote:
> Michael Haggerty <mhagger@alum.mit.edu> writes:
>
> > For this particular application, where we only have 19 strings to store,
> > I suppose we could tolerate the use of approximately 64k of RAM to store
> > 174 characters worth of strings *if* it would bring us big time savings.
> > But I think we need some evidence of the time savings.
> >
> > If this lookup is really a bottleneck, I bet there are other
> > alternatives that are just as fast as this trie and use less code,
> > especially given that there are only 19 strings that need checking.
>
> Very good point. I agree that we need to know that the dumb linear
> scan in the original is on the bottleneck and that any replacement
> is an improvement.
Just did a tiny bit of microbenchmarking:
The trie code is indeed somewhat faster, but it's not the bottleneck in
the git_path family of functions. The sprintf stuff takes way more
time. Most callers don't need this functionality (an append would do).
But this is a benchmark of just git_path. I don't happen to see any
cases where git_path is taking up an appreciable amount of runtime.
I only added this because Junio requested a speedup. So I am perfectly
happy to drop this patch from the series.
next prev parent reply other threads:[~2015-10-05 20:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-01 2:13 (unknown), David Turner
2015-09-01 2:13 ` [PATCH v5 1/3] refs: clean up common_list David Turner
2015-09-01 2:13 ` [PATCH v5 2/3] path: optimize common dir checking David Turner
2015-10-05 3:00 ` Michael Haggerty
2015-10-05 17:22 ` Junio C Hamano
2015-10-05 20:10 ` David Turner [this message]
2015-10-05 20:36 ` Junio C Hamano
2015-10-05 20:43 ` Junio C Hamano
2015-09-01 2:13 ` [PATCH v5 3/3] refs: make refs/bisect/* per-worktree David Turner
2015-09-01 16:32 ` making refs/bisect/ per worktree (was Re: (unknown)) Junio C Hamano
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=1444075810.5158.7.camel@twopensource.com \
--to=dturner@twopensource.com \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=mhagger@alum.mit.edu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.