git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Stephan Beyer <s-beyer@gmx.net>
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"René Scharfe" <l.s.r@web.de>, "Paul Tan" <pyokagan@gmail.com>,
	"brian m. carlson" <sandals@crustytoothpaste.net>,
	"Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
	git@vger.kernel.org
Subject: Re: [PATCH] Fix maybe-uninitialized warnings found by gcc 9 -flto
Date: Thu, 5 Sep 2019 21:24:30 -0400	[thread overview]
Message-ID: <20190906012430.GA29104@sigill.intra.peff.net> (raw)
In-Reply-To: <6894a758-d4ee-92e8-1aab-fc44c9ddcdc3@gmx.net>

On Fri, Sep 06, 2019 at 01:10:46AM +0200, Stephan Beyer wrote:

> I took a quick glance at yours. I also noticed the issue you address in
> [PATCH 2/6], but I was unsure if this is the way to go (I'm only
> occasionally reading on this list). I would prefer your patch series,
> with maybe one exception...

Yeah, we've been slowly removing these old "unsigned char *" references
(see a7db4c193d98f for the latest round touching this same code -- I'm
actually surprised I missed this one back then, as that's when
packlist_find() got converted).

> The thing is: I had *exactly* the same commit like your [PATCH 6/6]
> (except for the commit message and for the number), but I dropped it.
> Why? Because I had the feeling (no particular instance though) that the
> second locate_object_entry_hash() for each insertion *can* indeed take
> "too much" time. Also, I was wondering, if the "found = 1" case should
> be catched as a BUG("should not happen") or something.
> 
> I don't care much, though. The performance impact should probably be
> checked carefully.

I did measure it, like this:

  # Do the traversal separately. This would make any difference in the
  # pack-objects hash code stand out _more_, plus it makes it cheaper to
  # run multiple trials.
  git rev-list --objects --all >input

  # Make sure stderr is redirected to avoid progress, which again would
  # amplify any differences.
  git pack-objects --stdout --delta-base-offset <input >/dev/null 2>&1

Running on linux.git, I got:

  [before]
  Benchmark #1: git pack-objects --stdout --delta-base-offset <input >/dev/null 2>&1
    Time (mean ± σ):     26.225 s ±  0.233 s    [User: 24.089 s, System: 4.867 s]
    Range (min … max):   25.915 s … 26.555 s    10 runs

  [after]
  Benchmark #1: git pack-objects --stdout --delta-base-offset <input >/dev/null 2>&1
    Time (mean ± σ):     26.129 s ±  0.170 s    [User: 24.003 s, System: 4.958 s]
    Range (min … max):   25.974 s … 26.570 s    10 runs

So actually faster after, though not statistically significant. ;)

The BUG() on "found==1" might be worth doing.

-Peff

  reply	other threads:[~2019-09-06  1:24 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-05  8:24 [PATCH] Fix maybe-uninitialized warnings found by gcc 9 -flto Stephan Beyer
2019-09-05 17:08 ` René Scharfe
2019-09-05 17:53   ` Jeff King
2019-09-05 19:09     ` René Scharfe
2019-09-05 19:25       ` Junio C Hamano
2019-09-05 19:39         ` René Scharfe
2019-09-05 19:50           ` Junio C Hamano
2019-09-05 17:41 ` Junio C Hamano
2019-09-05 17:56 ` Junio C Hamano
2019-09-05 18:03   ` Jeff King
2019-09-05 18:22     ` Junio C Hamano
2019-09-05 22:48 ` Jeff King
2019-09-05 22:50   ` [PATCH 1/6] git-am: handle missing "author" when parsing commit Jeff King
2019-09-05 22:52   ` [PATCH 2/6] pack-objects: use object_id in packlist_alloc() Jeff King
2019-09-05 22:52   ` [PATCH 3/6] bulk-checkin: zero-initialize hashfile_checkpoint Jeff King
2019-09-05 22:53   ` [PATCH 4/6] diff-delta: set size out-parameter to 0 for NULL delta Jeff King
2019-09-05 22:53   ` [PATCH] Fix maybe-uninitialized warnings found by gcc 9 -flto Stephan Beyer
2019-09-05 22:58     ` Jeff King
2019-09-05 23:10       ` Stephan Beyer
2019-09-06  1:24         ` Jeff King [this message]
2019-09-06  1:36           ` [PATCH v2 6/6] pack-objects: drop packlist index_pos optimization Jeff King
2019-09-05 22:54   ` [PATCH 5/6] test-read-cache: drop namelen variable Jeff King
2019-09-05 22:56   ` [PATCH 6/6] pack-objects: drop packlist index_pos optimization 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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190906012430.GA29104@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=l.s.r@web.de \
    --cc=pyokagan@gmail.com \
    --cc=s-beyer@gmx.net \
    --cc=sandals@crustytoothpaste.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).