git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git log with ordering option and --first-parent is unnecessarily slow
@ 2016-04-09  3:55 Josiah Boning
  2016-04-09  5:01 ` Jeff King
  0 siblings, 1 reply; 3+ messages in thread
From: Josiah Boning @ 2016-04-09  3:55 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-04-09  5:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-09  3:55 git log with ordering option and --first-parent is unnecessarily slow Josiah Boning
2016-04-09  5:01 ` Jeff King
2016-04-09  5:42   ` Josiah Boning

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).