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 09:44:20 -0700 [thread overview]
Message-ID: <7vtxo8ody3.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20130318073229.GA5551@sigill.intra.peff.net> (Jeff King's message of "Mon, 18 Mar 2013 03:32:29 -0400")
Jeff King <peff@peff.net> writes:
> By the way, looking at that made me think for a few minutes about
> hashcmp, and I was surprised to find that we use an open-coded
> comparison loop. That dates back to this thread by Ingo:
>
> http://article.gmane.org/gmane.comp.version-control.git/172286
>
> I could not replicate his benchmarks at all. In fact, my measurements
> showed a slight slowdown with 1a812f3 (hashcmp(): inline memcmp() by
> hand to optimize, 2011-04-28).
>
> Here are my best-of-five numbers for running "git rev-list --objects
> --all >/dev/null" on linux-2.6.git:
>
> [current master, compiled with -O2]
> real 0m45.612s
> user 0m45.140s
> sys 0m0.300s
> ...
> [revert 1a812f3 (i.e., go back to memcmp), -O2]
> real 0m44.358s
> user 0m43.876s
> sys 0m0.316s
> ...
> I wonder why we get such different numbers. Ingo said his tests are on a
> Nehalem CPU, as are mine (mine is an i7-840QM). I wonder if we should be
> wrapping the optimization in an #ifdef, but I'm not sure which flag we
> should be checking.
FWIW, I am getting something like this on my
$ grep 'model name' /proc/cpuinfo | uniq -c
4 model name : Intel(R) Core(TM)2 Quad CPU Q9450 @ 2.66GHz
The same "rev-list --objects --all >/dev/null", best of five:
[current master, compiled with -O2]
real 0m39.956s
user 0m39.562s
sys 0m0.396s
[revert 1a812f3 (i.e., go back to memcmp), -O2]
real 0m42.161s
user 0m41.879s
sys 0m0.284s
It could be that the difference may be how well memcmp() is
optimized, no? My box runs Debian with libc6 2.11.3-4 and gcc
4.4.5.
next prev parent reply other threads:[~2013-03-18 16:44 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 [this message]
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
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=7vtxo8ody3.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 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.