-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Conversation
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 <[email protected]>
81eb4b9
to
71cc0bd
Compare
@@ -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.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
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)
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. |
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). |
I see. Please focus on the fix. |
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". |
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 <[email protected]>
checkout.c: enable fscache for checkout again
checkout.c: enable fscache for checkout again
checkout.c: enable fscache for checkout again
checkout.c: enable fscache for checkout again
…t_flush checkout.c: enable fscache for checkout again
…t_flush checkout.c: enable fscache for checkout again
…t_flush checkout.c: enable fscache for checkout again
checkout.c: enable fscache for checkout again
…t_flush checkout.c: enable fscache for checkout again
checkout.c: enable fscache for checkout again
checkout.c: enable fscache for checkout again
checkout.c: enable fscache for checkout again
…t_flush checkout.c: enable fscache for checkout again
…t_flush checkout.c: enable fscache for checkout again
checkout.c: enable fscache for checkout again
checkout.c: enable fscache for checkout again Signed-off-by: Johannes Schindelin <[email protected]>
checkout.c: enable fscache for checkout again Signed-off-by: Johannes Schindelin <[email protected]>
checkout.c: enable fscache for checkout again Signed-off-by: Johannes Schindelin <[email protected]>
checkout.c: enable fscache for checkout again Signed-off-by: Johannes Schindelin <[email protected]>
checkout.c: enable fscache for checkout again Signed-off-by: Johannes Schindelin <[email protected]>
checkout.c: enable fscache for checkout again Signed-off-by: Johannes Schindelin <[email protected]>
checkout.c: enable fscache for checkout again Signed-off-by: Johannes Schindelin <[email protected]>
checkout.c: enable fscache for checkout again Signed-off-by: Johannes Schindelin <[email protected]>
checkout.c: enable fscache for checkout again Signed-off-by: Johannes Schindelin <[email protected]>
checkout.c: enable fscache for checkout again Signed-off-by: Johannes Schindelin <[email protected]>
checkout.c: enable fscache for checkout again Signed-off-by: Johannes Schindelin <[email protected]>
…t_flush checkout.c: enable fscache for checkout again Signed-off-by: Johannes Schindelin <[email protected]>
…t_flush checkout.c: enable fscache for checkout again Signed-off-by: Johannes Schindelin <[email protected]>
checkout.c: enable fscache for checkout again Signed-off-by: Johannes Schindelin <[email protected]>
checkout.c: enable fscache for checkout again Signed-off-by: Johannes Schindelin <[email protected]>
checkout.c: enable fscache for checkout again Signed-off-by: Johannes Schindelin <[email protected]>
checkout.c: enable fscache for checkout again Signed-off-by: Johannes Schindelin <[email protected]>
checkout.c: enable fscache for checkout again Signed-off-by: Johannes Schindelin <[email protected]>
checkout.c: enable fscache for checkout again Signed-off-by: Johannes Schindelin <[email protected]>
checkout.c: enable fscache for checkout again Signed-off-by: Johannes Schindelin <[email protected]>
checkout.c: enable fscache for checkout again Signed-off-by: Johannes Schindelin <[email protected]>
checkout.c: enable fscache for checkout again Signed-off-by: Johannes Schindelin <[email protected]>
checkout.c: enable fscache for checkout again Signed-off-by: Johannes Schindelin <[email protected]>
checkout.c: enable fscache for checkout again Signed-off-by: Johannes Schindelin <[email protected]>
checkout.c: enable fscache for checkout again Signed-off-by: Johannes Schindelin <[email protected]>
checkout.c: enable fscache for checkout again Signed-off-by: Johannes Schindelin <[email protected]>
checkout.c: enable fscache for checkout again Signed-off-by: Johannes Schindelin <[email protected]>
checkout.c: enable fscache for checkout again Signed-off-by: Johannes Schindelin <[email protected]>
checkout.c: enable fscache for checkout again Signed-off-by: Johannes Schindelin <[email protected]>
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 Idelete 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 [email protected]