Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: git/git
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 36d2fca82b
Choose a base ref
...
head repository: git/git
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: dd2e50a84e
Choose a head ref
  • 2 commits
  • 2 files changed
  • 2 contributors

Commits on Sep 9, 2019

  1. commit-graph: don't show progress percentages while expanding reachab…

    …le commits
    
    Commit 49bbc57 (commit-graph write: emit a percentage for all
    progress, 2019-01-19) was a bit overeager when it added progress
    percentages to the "Expanding reachable commits in commit graph" phase
    as well, because most of the time the number of commits that phase has
    to iterate over is not known in advance and grows significantly, and,
    consequently, we end up with nonsensical numbers:
    
      $ git commit-graph write --reachable
      Expanding reachable commits in commit graph: 138606% (824706/595), done.
      [...]
    
      $ git rev-parse v5.0 | git commit-graph write --stdin-commits
      Expanding reachable commits in commit graph: 81264400% (812644/1), done.
      [...]
    
    Even worse, because the percentage grows so quickly, the progress code
    outputs much more often than it should (because it ticks every second,
    or every 1%), slowing the whole process down. My time for "git
    commit-graph write --reachable" on linux.git went from 13.463s to
    12.521s with this patch, ~7% savings.
    
    Therefore, don't show progress percentages in the "Expanding reachable
    commits in commit graph" phase.
    
    Note that the current code does sometimes do the right thing, if we
    picked up all commits initially (e.g., omitting "--reachable" in a
    fully-packed repository would get the correct count without any parent
    traversal). So it may be possible to come up with a way to tell when we
    could use a percentage here. But in the meantime, let's make sure we
    robustly avoid printing nonsense.
    
    Signed-off-by: SZEDER Gábor <[email protected]>
    Signed-off-by: Jeff King <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    szeder authored and gitster committed Sep 9, 2019
    Configuration menu
    Copy the full SHA
    67fa6aa View commit details
    Browse the repository at this point in the history
  2. commit-graph: turn off save_commit_buffer

    The commit-graph tool may read a lot of commits, but it only cares about
    parsing their metadata (parents, trees, etc) and doesn't ever show the
    messages to the user. And so it should not need save_commit_buffer,
    which is meant for holding onto the object data of parsed commits so
    that we can show them later. In fact, it's quite harmful to do so.
    According to massif, the max heap of "git commit-graph write
    --reachable" in linux.git before/after this patch (removing the commit
    graph file in between) goes from ~1.1GB to ~270MB.
    
    Which isn't surprising, since the difference is about the sum of the
    uncompressed sizes of all commits in the repository, and this was
    equivalent to leaking them.
    
    This obviously helps if you're under memory pressure, but even without
    it, things go faster. My before/after times for that command (without
    massif) went from 12.521s to 11.874s, a speedup of ~5%.
    
    Signed-off-by: Jeff King <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    peff authored and gitster committed Sep 9, 2019
    Configuration menu
    Copy the full SHA
    dd2e50a View commit details
    Browse the repository at this point in the history
Loading