From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Ingo Molnar <mingo@elte.hu>, Jonathan Nieder <jrnieder@gmail.com>,
Duy Nguyen <pclouds@gmail.com>,
Git Mailing List <git@vger.kernel.org>
Subject: Re: Make GIT_USE_LOOKUP default?
Date: Mon, 18 Mar 2013 11:40:12 -0700 [thread overview]
Message-ID: <7v38vso8kz.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20130318171949.GB15924@sigill.intra.peff.net> (Jeff King's message of "Mon, 18 Mar 2013 13:19:49 -0400")
Jeff King <peff@peff.net> writes:
> I do not see anything obviously wrong in it, though I did not walk
> through all of the ofs calculation to look for any clever speedups.
> However, I think it is clear from the other timings and Ingo's thread
> that glibc 2.11's memcmp does not perform very well on many short reads.
> And sha1_entry_pos will do memcmps even smaller than 20 bytes.
>
> What happens if you do this?
The overall trend is the same.
[without GIT_USE_LOOKUP]
real 0m40.044s
real 0m40.054s
real 0m40.072s
real 0m40.097s
real 0m40.159s
[with GIT_USE_LOOKUP]
real 0m40.257s
real 0m40.281s
real 0m40.311s
real 0m40.366s
real 0m40.407s
I suspect that after the first few rounds the range shrinks small
enough that the difference between a simple "mi = (hi + lo)/2" and
convoluted ofs computation becomes dominant. Perhaps we should only
do N-R for the initial midpoint selection and then fall back to a
stupid binary search?
next prev parent reply other threads:[~2013-03-18 18:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-17 13:25 Make GIT_USE_LOOKUP default? Duy Nguyen
2013-03-17 20:13 ` Junio C Hamano
2013-03-18 7:32 ` Jeff King
2013-03-18 16:44 ` Junio C Hamano
2013-03-18 16:49 ` Jeff King
2013-03-18 17:08 ` Junio C Hamano
2013-03-18 17:19 ` Jeff King
2013-03-18 18:40 ` Junio C Hamano [this message]
2013-03-19 15:43 ` Duy Nguyen
2013-03-19 15:55 ` Jeff King
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=7v38vso8kz.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=jrnieder@gmail.com \
--cc=mingo@elte.hu \
--cc=pclouds@gmail.com \
--cc=peff@peff.net \
/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).