public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Mitchel Humpherys <mitch.special@gmail•com>
To: git@vger•kernel.org
Cc: jonas@bernoul•li
Subject: Why is --graph --max-count=n so much slower than --graph HEAD~n..?
Date: Tue, 20 May 2014 15:17:01 -0700	[thread overview]
Message-ID: <vnkwd2f8ayea.fsf@mitchelh-linux.qualcomm.com> (raw)

I've noticed that --max-count doesn't seem to speed up `git log --graph'
computation time. Here are some numbers using the linux kernel
repository:

    | command                          | time* |
    |----------------------------------+-------|
    | git log --graph --max-count=5000 | 4.11s |
    | git log --graph --max-count=1000 | 4.05s |
    | git log --graph --max-count=500  | 3.95s |
    | git log --graph --max-count=50   | 3.95s |
    | git log --graph --max-count=10   | 3.97s |
    | git log --graph --max-count=1    | 3.96s |

However, specifying a manual revision range results in a much more
dramatic speedup as `n' decreases:

    | command                          | time* |
    |----------------------------------+-------|
    | git log --graph HEAD~5000..      | 6.69s |
    | git log --graph HEAD~1000..      | 1.89s |
    | git log --graph HEAD~500..       | 0.03s |
    | git log --graph HEAD~50..        | 0.02s |
    | git log --graph HEAD~10..        | 0.02s |
    | git log --graph HEAD~1..         | 0.00s |

* All times are "steady state" measurements after warming up the disk
  cache by running the command a few times.

I see that the manual revision range doesn't seem to go back as far in
history when I diff the output of the two commands. However, if I add
`--max-count=50' to the `HEAD~50..' command I get the exact same commits
but with fewer "dangling" lines at the bottom of the graph in the
`HEAD~50..' approach.

Anyone care to provide any insight about what's going on here? Is this
expected behavior? Is there any low-hanging fruit for optimizing
--max-count --graph?

-- 
Mitch

             reply	other threads:[~2014-05-20 22:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-20 22:17 Mitchel Humpherys [this message]
2014-05-20 22:50 ` Why is --graph --max-count=n so much slower than --graph HEAD~n..? Junio C Hamano
2014-05-21  0:13   ` Mitchel Humpherys
2014-05-21  0:24     ` Junio C Hamano

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=vnkwd2f8ayea.fsf@mitchelh-linux.qualcomm.com \
    --to=mitch.special@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=jonas@bernoul$(echo .)li \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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