git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Michael Haggerty <mhagger@alum.mit.edu>
To: Karthik Nayak <karthik.188@gmail.com>
Cc: git discussion list <git@vger.kernel.org>
Subject: Performance regression in `git branch` due to ref-filter usage
Date: Wed, 17 May 2017 13:14:34 +0200	[thread overview]
Message-ID: <dfc3a334-8047-26b0-1142-81c703010507@alum.mit.edu> (raw)

While working on reference code, I was running `git branch` under
`strace`, when I noticed that `$GIT_DIR/HEAD` was being `lstat()`ed and
`read()` 121 times. This is in a repository with 114 branches, so
probably it is being run once per branch. The extra work makes a
measurable difference to the (admittedly, short) runtime.

As recently as 2.12.3 the file was only read 4 times when running the
same command [1].

The regression bisects to

    949af0684c (branch: use ref-filter printing APIs, 2017-01-10)

It would be nice if these extra syscalls could be avoided.

I haven't checked whether other commands have similar regressions.

Michael

[1] One wonders why the file has to be read more than once, but that's a
different story and probably harder to fix.

             reply	other threads:[~2017-05-17 11:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-17 11:14 Michael Haggerty [this message]
2017-05-17 14:04 ` Performance regression in `git branch` due to ref-filter usage Jeff King
2017-05-19  6:12   ` [PATCH] ref-filter: resolve HEAD when parsing %(HEAD) atom Jeff King

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dfc3a334-8047-26b0-1142-81c703010507@alum.mit.edu \
    --to=mhagger@alum.mit.edu \
    --cc=git@vger.kernel.org \
    --cc=karthik.188@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).