From: Jeff King <peff@peff.net>
To: Michael Haggerty <mhagger@alum.mit.edu>
Cc: Duy Nguyen <pclouds@gmail.com>,
Junio C Hamano <gitster@pobox.com>,
David Turner <dturner@twopensource.com>,
Git Mailing List <git@vger.kernel.org>,
David Turner <dturner@twitter.com>
Subject: Re: [PATCH] check_refname_component: Optimize
Date: Fri, 30 May 2014 13:29:44 -0400 [thread overview]
Message-ID: <20140530172944.GC25443@sigill.intra.peff.net> (raw)
In-Reply-To: <538853B5.1080308@alum.mit.edu>
On Fri, May 30, 2014 at 11:47:33AM +0200, Michael Haggerty wrote:
> > I could guess something like "the writer has a different idea of what a
> > valid refname is than we do". But that applies as well to (2), but just
> > as "the reader who wrote packed-refs.stat has a different idea than we
> > do".
>
> If we want to be robust to future changes to refname rules, we could add
> a header flag like
>
> # pack-refs with: peeled fully-peeled check-level=1.0
>
> which promises that the reference names in the file conform to the
> current ("version 1.0") check_refname_format() rules.
Yeah, I thought about mentioning something like that. But really, this
just seems like a lot of complexity to solve the problem in a wrong way.
It's not running check_refname_format that is the real problem. It's the
fact that we do O(# of refs) work whenever we have to access the
packed-refs file. check_refname_format is part of that, surely, but so
is reading the file, creating all of the refname structs in memory, etc.
I'd much rather see a solution that lets us do O(log N) or O(1) work to
access a ref, and then we don't have to care about optimizing
check_refname_format specifically.
I don't mind internal code speedups to micro-optimize check_refname_format.
They may make the code uglier, but they're fairly contained. But things
like check-level are much more invasive, and we'll need to keep
compatibility with them in future versions.
-Peff
next prev parent reply other threads:[~2014-05-30 17:29 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-28 21:04 [PATCH v2 0/1] check_refname_component: Optimize David Turner
2014-05-28 21:04 ` [PATCH] " David Turner
2014-05-28 21:44 ` Michael Haggerty
2014-05-28 23:49 ` David Turner
2014-05-29 13:41 ` Duy Nguyen
2014-05-29 16:36 ` Junio C Hamano
2014-05-29 23:24 ` Duy Nguyen
2014-05-29 23:41 ` Jeff King
2014-05-29 23:43 ` Duy Nguyen
2014-05-30 0:07 ` Jeff King
2014-05-30 2:03 ` Duy Nguyen
2014-05-30 9:47 ` Michael Haggerty
2014-05-30 17:29 ` Jeff King [this message]
2014-05-31 10:47 ` Michael Haggerty
2014-05-31 11:21 ` Duy Nguyen
-- strict thread matches above, loose matches on Subject: below --
2014-05-28 19:57 David Turner
2014-05-28 21:24 ` Junio C Hamano
2014-05-29 12:19 ` brian m. carlson
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=20140530172944.GC25443@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=dturner@twitter.com \
--cc=dturner@twopensource.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=mhagger@alum.mit.edu \
--cc=pclouds@gmail.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).