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

read-cache: run verify_hdr() in background thread #978

Merged

Conversation

jeffhostetler
Copy link

This is a performance optimization.

Teach do_read_index() to call verify_hdr() using a thread
and allow SHA1 verification to run concurrently with the
parsing of index-entries and extensions.

For large index files, this cuts the startup time in half.

Signed-off-by: Jeff Hostetler jeffhost@microsoft.com

This is a performance optimization.

Teach do_read_index() to call verify_hdr() using a thread
and allow SHA1 verification to run concurrently with the
parsing of index-entries and extensions.

For large index files, this cuts the startup time in half.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
@dscho dscho merged commit 8e6ca48 into git-for-windows:master Dec 2, 2016
@dscho
Copy link
Member

dscho commented Dec 2, 2016

Very nice! I think I will refactor this a little bit when sending it upstream, so that we end up with a single #ifdef NO_PTHREAD ... #else ... #endif construct containing two static functions.

dscho added a commit to git-for-windows/build-extra that referenced this pull request Dec 2, 2016
Reading a large index [has been speeded up using
pthreads](git-for-windows/git#978).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho modified the milestones: v2.11.0, v2.11.1 Dec 2, 2016
@jeffhostetler
Copy link
Author

That's fine. I was mainly concentrating on the timings for (very) large repos. I also expect a discussion on the threshold value for enabling it. On a 16Mb index file, it saved about 0.03 seconds. On a 450Mb index file it saved 0.7 seconds -- which gives us 10-20% on short-running commands.

@jeffhostetler
Copy link
Author

And thanks for the quick review!

dscho added a commit that referenced this pull request Dec 6, 2016
…y_hdr

read-cache: run verify_hdr() in background thread
dscho added a commit that referenced this pull request Dec 12, 2016
…y_hdr

read-cache: run verify_hdr() in background thread
dscho added a commit that referenced this pull request Jan 11, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
dscho added a commit that referenced this pull request Jan 18, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
dscho added a commit that referenced this pull request Jan 18, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
git-for-windows-ci pushed a commit that referenced this pull request Jan 18, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
git-for-windows-ci pushed a commit that referenced this pull request Jan 18, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
git-for-windows-ci pushed a commit that referenced this pull request Jan 18, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
dscho added a commit that referenced this pull request Jan 24, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
dscho added a commit that referenced this pull request Jan 24, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
dscho added a commit that referenced this pull request Jan 24, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
dscho added a commit that referenced this pull request Jan 25, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
dscho added a commit that referenced this pull request Jan 25, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
dscho added a commit that referenced this pull request Jan 25, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
dscho added a commit that referenced this pull request Jan 25, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
@jeffhostetler jeffhostetler deleted the jeffhostetler/thread_verify_hdr branch January 25, 2017 20:02
dscho added a commit to dscho/git that referenced this pull request Feb 1, 2017
…er/thread_verify_hdr

read-cache: run verify_hdr() in background thread
dscho added a commit that referenced this pull request Feb 2, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
git-for-windows-ci pushed a commit that referenced this pull request Feb 2, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
git-for-windows-ci pushed a commit that referenced this pull request Sep 20, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
dscho added a commit that referenced this pull request Sep 20, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
git-for-windows-ci pushed a commit that referenced this pull request Sep 21, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
git-for-windows-ci pushed a commit that referenced this pull request Sep 21, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
git-for-windows-ci pushed a commit that referenced this pull request Sep 26, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
git-for-windows-ci pushed a commit that referenced this pull request Sep 26, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
dscho added a commit that referenced this pull request Sep 26, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
dscho added a commit that referenced this pull request Oct 17, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
dscho added a commit that referenced this pull request Oct 19, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
dscho added a commit that referenced this pull request Oct 19, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
dscho added a commit that referenced this pull request Oct 19, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
dscho added a commit that referenced this pull request Oct 19, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
dscho added a commit that referenced this pull request Oct 19, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
git-for-windows-ci pushed a commit that referenced this pull request Oct 20, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
git-for-windows-ci pushed a commit that referenced this pull request Oct 20, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
git-for-windows-ci pushed a commit that referenced this pull request Oct 20, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
dscho added a commit that referenced this pull request Oct 20, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
git-for-windows-ci pushed a commit that referenced this pull request Oct 21, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
dscho added a commit that referenced this pull request Oct 23, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
git-for-windows-ci pushed a commit that referenced this pull request Oct 24, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
dscho added a commit that referenced this pull request Oct 30, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
dscho added a commit that referenced this pull request Nov 1, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
dscho added a commit that referenced this pull request Nov 6, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
git-for-windows-ci pushed a commit that referenced this pull request Nov 7, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
dscho added a commit that referenced this pull request Nov 29, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
git-for-windows-ci pushed a commit that referenced this pull request Dec 6, 2017
…y_hdr

read-cache: run verify_hdr() in background thread
dscho added a commit that referenced this pull request Jan 2, 2018
…y_hdr

read-cache: run verify_hdr() in background thread
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.

None yet

2 participants