git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jameson Miller <jameson.miller81@gmail.com>
To: jameson.miller81@gmail.com
Cc: bmwill@google.com, git@vger.kernel.org, gitster@pobox.com,
	jamill@microsoft.com, peff@peff.net, sxlijin@gmail.com
Subject: [PATCH v2] Improve performance of git status --ignored
Date: Mon, 18 Sep 2017 13:24:32 -0400	[thread overview]
Message-ID: <1505755473-6720-1-git-send-email-jamill@microsoft.com> (raw)
In-Reply-To: <20170810184936.239542-1-jamill@microsoft.com>

This is the second version of my patches to improve handling of
ignored files

I have decided to break the original patch series into two parts:

 1) Perf improvements to handling ignored directories

 2) Expose extra options to control which ignored files are displayed
 by git status.

This patch will address #1, and I will follow up with another patch
for #2.

This patch improves the performance of 'git status --ignored' by
cutting out unnecessary work when determining if an ignored directory
is empty or not. The current logic will recursively enumerate through
all contents of an ignored directory to determine whether it is empty
or not. The new logic will return after the 1st file is
encountered. This can result in a significant speedup in work dirs
with a lot of files in ignored directories.

As an example of the performance improvement, here is a representative
example of a repository with ~190,000 files in ~400 ignored
directories:

| Command                    | Time (s) |
| -------------------------- | -------- |
| git status                 |    1.2   |
| git status --ignored (old) |    3.9   |
| git status --ignored (new) |    1.4   |

Jameson Miller (1):
  Improve performance of git status --ignored

 dir.c | 47 +++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 41 insertions(+), 6 deletions(-)

-- 
2.7.4


  parent reply	other threads:[~2017-09-18 17:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-10 18:49 [PATCH v1 0/1] Teach status to show ignored directories Jameson Miller
2017-08-10 18:49 ` [PATCH v1 1/1] dir: teach " Jameson Miller
2017-08-10 20:03   ` Stefan Beller
2017-08-11 17:48     ` Jameson Miller
2017-08-14 21:05       ` Stefan Beller
2017-08-11 17:39   ` Brandon Williams
2017-08-11 18:29     ` Jameson Miller
2017-09-18 17:24 ` Jameson Miller [this message]
2017-09-18 17:24   ` [PATCH v2] Improve performance of git status --ignored Jameson Miller
2017-09-19  3:27     ` Junio C Hamano
2017-09-19 17:52     ` Brandon Williams

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=1505755473-6720-1-git-send-email-jamill@microsoft.com \
    --to=jameson.miller81@gmail.com \
    --cc=bmwill@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jamill@microsoft.com \
    --cc=peff@peff.net \
    --cc=sxlijin@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).