Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checkout.c: enable fscache for checkout again #1468

Merged
merged 1 commit into from
Feb 27, 2018

Conversation

atetubou
Copy link

@atetubou atetubou commented Jan 30, 2018

This is retry of #1419.

I added flush_fscache macro to flush cached stats after disk writing
with tests for regression reported in #1438 and #1442.

git checkout checks each file path in sorted order, so cache flushing does not
make performance worse unless we have large number of modified files in
a directory containing many files.

Using chromium repository, I tested git checkout . performance when I
delete 10 files in different directories.
With this patch:
TotalSeconds: 4.307272
TotalSeconds: 4.4863595
TotalSeconds: 4.2975562
Avg: 4.36372923333333

Without this patch:
TotalSeconds: 20.9705431
TotalSeconds: 22.4867685
TotalSeconds: 18.8968292
Avg: 20.7847136

I confirmed this patch passed all tests in t/ with core_fscache=1.

Signed-off-by: Takuto Ikuta tikuta@chromium.org

This is retry of git-for-windows#1419.

I added flush_fscache macro to flush cached stats after disk writing
with tests for regression reported in git-for-windows#1438 and git-for-windows#1442.

git checkout checks each file path in sorted order, so cache flushing does not
make performance worse unless we have large number of modified files in
a directory containing many files.

Using chromium repository, I tested `git checkout .` performance when I
delete 10 files in different directories.
With this patch:
TotalSeconds: 4.307272
TotalSeconds: 4.4863595
TotalSeconds: 4.2975562
Avg: 4.36372923333333

Without this patch:
TotalSeconds: 20.9705431
TotalSeconds: 22.4867685
TotalSeconds: 18.8968292
Avg: 20.7847136

I confirmed this patch passed all tests in t/ with core_fscache=1.

Signed-off-by: Takuto Ikuta <tikuta@chromium.org>
@@ -366,6 +366,9 @@ static int write_entry(struct cache_entry *ce,
}

finish:
// Flush cached lstat in fscache after writing disk.
flush_fscache();

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@atetubou
Copy link
Author

atetubou commented Feb 5, 2018

Can we move forward on this PR? 20 seconds checkout is slow and give us less productivity.

git checkout for path runs like below (simplified very much)

for each path in git index
  if stat of path is different from index # This is slow if we call GetFileAttributes
    do some modification on the path
    update stat in git index # After this, stat of this file won't be used. So keeping fscache consistent with disk does not have much benefit.

If you don't hesitate to change git more largely, I can change git to take stat of all files before any file modification using fscache.

@dscho
Copy link
Member

dscho commented Feb 5, 2018

Can we move forward on this PR?

Sorry, I'd love to, but first I have to work on yet another Git for Windows version... there have been two stupid breakages in v2.16.1(2).

@atetubou
Copy link
Author

atetubou commented Feb 6, 2018

I see. Please focus on the fix.

@atetubou
Copy link
Author

Ping? How do you think the way like scoped fscache?

@dscho
Copy link
Member

dscho commented Feb 27, 2018

Ping? How do you think the way like scoped fscache?

Sorry for the long delay. I think you are right, this PR strikes the best balance between simplicity and "bang for the buck".

@dscho dscho merged commit 07867ae into git-for-windows:master Feb 27, 2018
@dscho dscho added this to the v2.16.2(2) milestone Feb 27, 2018
dscho added a commit to git-for-windows/build-extra that referenced this pull request Feb 27, 2018
In conjunction with the FSCache feature, `git checkout`
[is now a lot faster when checking out a *lot* of
files](git-for-windows/git#1468).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit that referenced this pull request Mar 23, 2018
checkout.c: enable fscache for checkout again
dscho added a commit that referenced this pull request Apr 3, 2018
checkout.c: enable fscache for checkout again
dscho added a commit that referenced this pull request May 29, 2018
checkout.c: enable fscache for checkout again
dscho added a commit that referenced this pull request May 29, 2018
checkout.c: enable fscache for checkout again
PKRoma pushed a commit to PKRoma/git-for-windows that referenced this pull request Jun 22, 2018
…t_flush

checkout.c: enable fscache for checkout again
PKRoma pushed a commit to PKRoma/git-for-windows that referenced this pull request Jun 22, 2018
…t_flush

checkout.c: enable fscache for checkout again
PKRoma pushed a commit to PKRoma/git-for-windows that referenced this pull request Jun 22, 2018
…t_flush

checkout.c: enable fscache for checkout again
dscho added a commit that referenced this pull request Aug 22, 2018
checkout.c: enable fscache for checkout again
dscho added a commit to dscho/git that referenced this pull request Aug 22, 2018
…t_flush

checkout.c: enable fscache for checkout again
dscho added a commit that referenced this pull request Aug 23, 2018
checkout.c: enable fscache for checkout again
dscho added a commit that referenced this pull request Aug 23, 2018
checkout.c: enable fscache for checkout again
dscho added a commit that referenced this pull request Aug 23, 2018
checkout.c: enable fscache for checkout again
jamill pushed a commit to jamill/git that referenced this pull request Aug 28, 2018
…t_flush

checkout.c: enable fscache for checkout again
jamill pushed a commit to jamill/git that referenced this pull request Sep 5, 2018
…t_flush

checkout.c: enable fscache for checkout again
git-for-windows-ci pushed a commit that referenced this pull request Sep 10, 2018
checkout.c: enable fscache for checkout again
dscho added a commit that referenced this pull request Sep 26, 2024
checkout.c: enable fscache for checkout again

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit that referenced this pull request Sep 26, 2024
checkout.c: enable fscache for checkout again

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit that referenced this pull request Sep 26, 2024
checkout.c: enable fscache for checkout again

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit that referenced this pull request Sep 27, 2024
checkout.c: enable fscache for checkout again

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit to dscho/git that referenced this pull request Oct 3, 2024
…t_flush

checkout.c: enable fscache for checkout again

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit to dscho/git that referenced this pull request Oct 4, 2024
…t_flush

checkout.c: enable fscache for checkout again

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
git-for-windows-ci pushed a commit that referenced this pull request Oct 4, 2024
checkout.c: enable fscache for checkout again

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
git-for-windows-ci pushed a commit that referenced this pull request Oct 4, 2024
checkout.c: enable fscache for checkout again

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
git-for-windows-ci pushed a commit that referenced this pull request Oct 4, 2024
checkout.c: enable fscache for checkout again

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit to dscho/git that referenced this pull request Oct 8, 2024
…t_flush

checkout.c: enable fscache for checkout again

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
git-for-windows-ci pushed a commit that referenced this pull request Oct 8, 2024
checkout.c: enable fscache for checkout again

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit that referenced this pull request Oct 8, 2024
checkout.c: enable fscache for checkout again

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit that referenced this pull request Oct 8, 2024
checkout.c: enable fscache for checkout again

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit that referenced this pull request Oct 8, 2024
checkout.c: enable fscache for checkout again

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
git-for-windows-ci pushed a commit that referenced this pull request Oct 9, 2024
checkout.c: enable fscache for checkout again

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
git-for-windows-ci pushed a commit that referenced this pull request Oct 9, 2024
checkout.c: enable fscache for checkout again

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
git-for-windows-ci pushed a commit that referenced this pull request Oct 9, 2024
checkout.c: enable fscache for checkout again

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
git-for-windows-ci pushed a commit that referenced this pull request Oct 9, 2024
checkout.c: enable fscache for checkout again

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit that referenced this pull request Oct 9, 2024
checkout.c: enable fscache for checkout again

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit that referenced this pull request Oct 9, 2024
checkout.c: enable fscache for checkout again

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit that referenced this pull request Oct 10, 2024
checkout.c: enable fscache for checkout again

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit that referenced this pull request Oct 10, 2024
checkout.c: enable fscache for checkout again

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit that referenced this pull request Oct 10, 2024
checkout.c: enable fscache for checkout again

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
git-for-windows-ci pushed a commit that referenced this pull request Oct 10, 2024
checkout.c: enable fscache for checkout again

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
git-for-windows-ci pushed a commit that referenced this pull request Oct 10, 2024
checkout.c: enable fscache for checkout again

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
git-for-windows-ci pushed a commit that referenced this pull request Oct 11, 2024
checkout.c: enable fscache for checkout again

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
git-for-windows-ci pushed a commit that referenced this pull request Oct 11, 2024
checkout.c: enable fscache for checkout again

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit that referenced this pull request Oct 11, 2024
checkout.c: enable fscache for checkout again

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit that referenced this pull request Oct 11, 2024
checkout.c: enable fscache for checkout again

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit that referenced this pull request Oct 11, 2024
checkout.c: enable fscache for checkout again

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants