git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Elijah Newren <newren@gmail.com>
To: Victoria Dye <vdye@github.com>
Cc: Git Mailing List <git@vger.kernel.org>,
	Derrick Stolee <stolee@gmail.com>,
	Lessley Dennington <lessleydennington@gmail.com>
Subject: Re: [RFC PATCH 5/5] Accelerate ensure_skip_worktree_means_skip_worktree by caching
Date: Tue, 11 Jan 2022 14:04:45 -0800	[thread overview]
Message-ID: <CABPp-BHEuLB9u1ggDUsTZ_85S52XScM4znM7dnrQQ1iKnXxmhw@mail.gmail.com> (raw)
In-Reply-To: <950da537-941f-dfb4-460a-1aa4c68e0750@github.com>

On Tue, Jan 11, 2022 at 10:30 AM Victoria Dye <vdye@github.com> wrote:
>
> Elijah Newren wrote:
> > Rather than lstat()'ing every SKIP_WORKTREE path, take advantage of the
> > fact that entire directories will often be missing, especially for cone
> > mode and even more so ever since commit 55dfcf9591 ("sparse-checkout:
> > clear tracked sparse dirs", 2021-09-08).  If we have already determined
> > that the parent directory of a file (or any other previous ancestor)
> > does not exist, then we already know the file cannot exist and do not
> > need to lstat() it separately.
> >
> > Granted, the cost of ensure_skip_worktree_means_skip_worktree() might
> > be considered a bit high for non-cone mode since it might now lstat()
> > every SKIP_WORKTREE path when the index is loaded (an O(N) cost, with
> > N the number of SKIP_WORKTREE paths), but non-cone mode users already
> > have to deal with the O(N*M) cost (with N=the number of tracked files
> > and M=the number of sparsity patterns), so this should be reasonable.
> >
>
> Did you write/run any performance tests to see how this optimization changed
> the execution time? If not, running the `p2000` performance tests against
> the patch series base, [3/5], and [5/5] would provide some really helpful
> insight into the cost of `ensure_skip_worktree_means_skip_worktree`, then
> how much this optimization improves it.

I haven't[1].  You bring up a very good point; I'll add it for the next round.

[1] Long, probably irrelevant story about why: My original patches
were actually going to go further and just remove the
present-despite-SKIP_WORKTREE files in _all_ cases, sparse-checkout or
not. It had not occurred to me while writing the patches to make it
specific to sparse-checkouts.  Because of that, I figured it was
better to get feedback on if the idea was acceptable and spent a lot
more time concentrating on making the case.  Then I realized near the
end that folks who don't use sparse-checkout or SKIP_WORKTREE might be
annoyed at the overhead also being added for them, for a feature
they'll never even use.  I decided to back off a bit, and make it
sparse-checkout specific.  Then I realized that backing off might just
keep all users happy anyway (the folks who intentionally use
present-despite-SKIP_WORKTREE paths, despite their many warts, can
keep doings so) and edited a lot of my commit messages, docs, and
cover letter.  And by then it was late Saturday night and I had
promised to send out my series on Friday.  Since I had already marked
my cover letter as RFC anyway, I just decided to temporarily punt on
getting performance numbers...

      reply	other threads:[~2022-01-11 22:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-09  4:57 [RFC PATCH 0/5] Remove the present-despite-SKIP_WORKTREE class of bugs Elijah Newren
2022-01-09  4:57 ` [RFC PATCH 1/5] t1011: add testcase demonstrating accidental loss of user modifications Elijah Newren
2022-01-09  4:57 ` [RFC PATCH 2/5] unpack-trees: fix accidental loss of user changes Elijah Newren
2022-01-09  4:57 ` [RFC PATCH 3/5] repo_read_index: ensure SKIP_WORKTREE means skip worktree Elijah Newren
2022-01-10 20:38   ` Victoria Dye
2022-01-11 19:27     ` Elijah Newren
2022-01-11 23:09       ` Victoria Dye
2022-01-09  4:57 ` [RFC PATCH 4/5] Update documentation related to sparsity and the skip-worktree bit Elijah Newren
2022-01-09  4:57 ` [RFC PATCH 5/5] Accelerate ensure_skip_worktree_means_skip_worktree by caching Elijah Newren
2022-01-11 18:30   ` Victoria Dye
2022-01-11 22:04     ` Elijah Newren [this message]

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=CABPp-BHEuLB9u1ggDUsTZ_85S52XScM4znM7dnrQQ1iKnXxmhw@mail.gmail.com \
    --to=newren@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=lessleydennington@gmail.com \
    --cc=stolee@gmail.com \
    --cc=vdye@github.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).