From: Josiah Boning <jboning@gmail.com>
To: git@vger.kernel.org
Subject: git log with ordering option and --first-parent is unnecessarily slow
Date: Fri, 8 Apr 2016 20:55:54 -0700 [thread overview]
Message-ID: <CAKdicq8MnZMBV97K5O8Oa1T=PT9DsutmBS+P-bFYitATHH3s+Q@mail.gmail.com> (raw)
As measured on linux.git, adding --date-order to a log command can
result in a significant slowdown (~25x here; I've seen ~100x on other
repositories):
$ time git log --first-parent --max-count=51 master > /dev/null
real 0m0.024s
user 0m0.006s
sys 0m0.016s
$ time git log --date-order --first-parent --max-count=51 master > /dev/null
real 0m0.652s
user 0m0.570s
sys 0m0.074s
In combination with --first-parent, --date-order (or any other
ordering option) should be a no-op, since --first-parent selects a
linear history. So it seems like there's a significant performance win
available by ignoring ordering options when --first-parent is present.
Would this change be desirable? If so, I'll see about submitting a
patch.
More generally, it seems like it might be possible to identify when
the selected commits are linear and avoid the cost of sorting.
Josiah
next reply other threads:[~2016-04-09 3:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-09 3:55 Josiah Boning [this message]
2016-04-09 5:01 ` git log with ordering option and --first-parent is unnecessarily slow Jeff King
2016-04-09 5:42 ` Josiah Boning
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='CAKdicq8MnZMBV97K5O8Oa1T=PT9DsutmBS+P-bFYitATHH3s+Q@mail.gmail.com' \
--to=jboning@gmail.com \
--cc=git@vger.kernel.org \
/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 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 NNTP newsgroup(s).