From: Thomas Rast Date: Mon, 06 Dec 2010 10:53:59 GMT Subject: Re: [PATCH] describe: Don’t look up commits with --exact-match Message-ID: <201012061153.59635.trast@student.ethz.ch> In-Reply-To: <20101206073214.GA3745@burratino> Jonathan Nieder wrote: > Anders Kaseorg wrote: > > On Fri, 3 Dec 2010, Jonathan Nieder wrote: > > >> Instead of looking up the commit to be matched exactly in the commits > >> hash table, this makes a linear search. > [...] > > I don’t think it’s ever a problem: in my repository with 1800 tags on a > > warm cache, that loop accounts for about 0.1% of even the fastest > > non-exact-match query (a commit right after a tag). > > Thanks for checking. Makes sense. Apart from measuring: for_each_ref *loads* the tags in a linear scan, so another linear scan doesn't add to the runtime w.r.t. number of tags. It only hurts if you also describe many refs in one go. -- Thomas Rast trast@{inf,student}.ethz.ch