git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Fix maybe-uninitialized warnings found by gcc 9 -flto

From
Jeff King <peff@peff.net>
Date
Sep 6, 2019, 01:24 UTC
Message-ID
<20190906012430.GA29104@sigill.intra.peff.net>
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).

Show 9 quoted lines
> 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
Previous: Stephan BeyerNext: Jeff King
Message 20 of 23 in “Fix maybe-uninitialized warnings found by gcc 9 -flto”
  1. Fix maybe-uninitialized warnings found by gcc 9 -fltoStephan Beyer, Sep 5, 2019
  2. René ScharfeSep 5, 2019
  3. Jeff KingSep 5, 2019
  4. René ScharfeSep 5, 2019
  5. Junio C HamanoSep 5, 2019
  6. René ScharfeSep 5, 2019
  7. Junio C HamanoSep 5, 2019
  8. Junio C HamanoSep 5, 2019
  9. Junio C HamanoSep 5, 2019
  10. Jeff KingSep 5, 2019
  11. Junio C HamanoSep 5, 2019
  12. Jeff KingSep 5, 2019
  13. 1/6 git-am: handle missing "author" when parsing commitJeff King, Sep 5, 2019
  14. 2/6 pack-objects: use object_id in packlist_alloc()Jeff King, Sep 5, 2019
  15. 3/6 bulk-checkin: zero-initialize hashfile_checkpointJeff King, Sep 5, 2019
  16. 4/6 diff-delta: set size out-parameter to 0 for NULL deltaJeff King, Sep 5, 2019
  17. Stephan BeyerSep 5, 2019
  18. Jeff KingSep 5, 2019
  19. Stephan BeyerSep 5, 2019
  20. Jeff KingSep 6, 2019
  21. 6/6 pack-objects: drop packlist index_pos optimizationJeff King, Sep 6, 2019
  22. 5/6 test-read-cache: drop namelen variableJeff King, Sep 5, 2019
  23. 6/6 pack-objects: drop packlist index_pos optimizationJeff King, Sep 5, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.