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

enable fscache while iterating every local refs #1372

Merged
merged 1 commit into from
Nov 25, 2017

Conversation

atetubou
Copy link

@atetubou atetubou commented Nov 22, 2017

When I do git fetch, git reads entries in .git/objects/pack for every refs in local repository.

By enabling fscache, directory list up in .git/objects/pack for each refs is cached.
Without fscache, such behavior causes long running time when we do git fetch in local repository having many refs.

This patch improves execution time in such case, especially in very large repository like chromium.
In my windows workstation, this patch improves git fetch time from more than 3 minutes to less than 20 seconds for chromium repository.

Signed-off-by: Takuto Ikuta [email protected]

@PhilipOakley
Copy link

Doesn't this (enable_fscache) need switching off at some point?

The preload-index.c there are complementary settings as part of the PTHREADS code. However the other two uses don't appear to have the un-setting part. Dunno.

Which ever way it is, could you clarify the result in the commit message? (force push you branch to create the updated PR in this thread..)

@atetubou atetubou force-pushed the enable_fscache_fetch branch 2 times, most recently from a99b5e1 to 25bfebc Compare November 22, 2017 15:55
@atetubou
Copy link
Author

Thank you for comment. I updated commit to disable fscache after iteration.

@PhilipOakley
Copy link

It took me a bit of searching..

The enable_fscache() is redefined either to a noop /* */ or fscache_enable() - its is difficult to see the swap around in the function names !

The fscache_enable() is then defined in \git\compat\win32\fscache.c, so you should be able to check there if it is "The Right Thing" (TM) to unset the setting, hence my original question. The commit message should reassure the reader that it is the right thing to do.

It wasn't clear to me why we do not need to unset it in the other two use cases. The message should help clarify (maybe it depends on whether we have a long running command/ command in multiple threads)

@atetubou atetubou force-pushed the enable_fscache_fetch branch 2 times, most recently from de9b3dc to d2c69f4 Compare November 24, 2017 02:33
@atetubou atetubou changed the title enable fscache when iterating every local refs enable fscache while iterating every local refs Nov 24, 2017
When I do git fetch, git reads entries in .git/objects/pack for every refs in local repository.

By enabling fscache, directory list up in .git/objects/pack for each refs is cached.
Without fscache, such behavior causes long running time when we do git fetch in local repository having many refs.

This patch improves execution time in such case, especially in very large repository like chromium.
In my windows workstation, this patch improves git fetch time from more than 3 minutes to less than 20 seconds for chromium repository.

Signed-off-by: Takuto Ikuta <[email protected]>
@atetubou atetubou force-pushed the enable_fscache_fetch branch from d2c69f4 to 09ccec4 Compare November 24, 2017 02:39
@atetubou
Copy link
Author

The fscache_enable() is then defined in \git\compat\win32\fscache.c, so you should be able to check there if it is "The Right Thing" (TM) to unset the setting, hence my original question. The commit message should reassure the reader that it is the right thing to do.

Updated bit again, do I understand what you said?

@dscho
Copy link
Member

dscho commented Nov 25, 2017

It is always a pleasure to come back from vacation and see new contributions, in particular when two contributors worked together to further improve them. Thank you so much @atetubou and @PhilipOakley!

@dscho dscho merged commit cf9318d into git-for-windows:master Nov 25, 2017
@PhilipOakley
Copy link

@dscho thanks for the support. The main praise must go to @atetubou for the work. I was mainly reflecting on my ignorance of fscache_enable (and enable_fscache ;) , hence my requests to see if the code needed the 'off' swich step. Plus I thought it was already switched on in GfW by default. Any thoughs @dscho?

@dscho
Copy link
Member

dscho commented Nov 26, 2017

I thought it was already switched on in GfW by default.

I did that in some topic branch for testing, it needs a patch: dscho@f3cac14

Stupidly, I forgot to record details of the "why?", so I'll have to reconstruct them before I can cherry-pick that to master.

Also, there were some bad interactions between sparse checkouts and fscache, that was the reason I did not switch it to "on" by default. I'll have to check back with @jeffhostetler who performed those tests whether the issues have been resolved.

dscho added a commit to git-for-windows/build-extra that referenced this pull request Nov 26, 2017
Running `git fetch` in a repository with lots of refs [is now
considerably faster](git-for-windows/git#1372).

Signed-off-by: Johannes Schindelin <[email protected]>
@dscho dscho added this to the v2.15.0(2) milestone Nov 29, 2017
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.

3 participants