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: speed up add_index_entry during checkout #988

Merged

Conversation

jeffhostetler
Copy link

Teach add_index_entry_with_check() and has_dir_name()
to see if the path of the new item is greater than the
last path in the index array before attempting to search
for it.

This is a performance optimization.

During checkout, merge_working_tree() populates the new
index in sorted order, so this change saves at least 2
lookups per file.

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

@jeffhostetler
Copy link
Author

I marked this WIP for now because I think it'll need some tests.

This change sped up a "git checkout -b new" (new branch name, same commit) by 2.5 seconds on my very large repo.

Teach add_index_entry_with_check() and has_dir_name()
to see if the path of the new item is greater than the
last path in the index array before attempting to search
for it.

This is a performance optimization.

During checkout, merge_working_tree() populates the new
index in sorted order, so this change saves at least 2
lookups per file.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
@jeffhostetler jeffhostetler force-pushed the jeffhostetler/quick_add_index_entry branch from 1705311 to 3afab69 Compare December 8, 2016 15:56
@jeffhostetler jeffhostetler changed the title WIP read-cache: speed up add_index_entry during checkout read-cache: speed up add_index_entry during checkout Dec 9, 2016
@jeffhostetler
Copy link
Author

This also improved read-tree by 15% on my large repo.

@dscho dscho merged commit 13d7269 into git-for-windows:master Dec 12, 2016
@dscho
Copy link
Member

dscho commented Dec 12, 2016

Thanks, and sorry for the delay!

dscho added a commit that referenced this pull request Dec 12, 2016
…dex_entry

read-cache: speed up add_index_entry during checkout
@dscho dscho modified the milestone: v2.11.1 Dec 22, 2016
dscho added a commit to git-for-windows/build-extra that referenced this pull request Dec 23, 2016
The `checkout` operation [was speeded
up](git-for-windows/git#988) for the common
cases.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit that referenced this pull request Jan 11, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
dscho added a commit that referenced this pull request Jan 18, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
dscho added a commit that referenced this pull request Jan 18, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
git-for-windows-ci pushed a commit that referenced this pull request Jan 18, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
git-for-windows-ci pushed a commit that referenced this pull request Jan 18, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
git-for-windows-ci pushed a commit that referenced this pull request Jan 18, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
dscho added a commit that referenced this pull request Jan 24, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
dscho added a commit that referenced this pull request Jan 24, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
dscho added a commit that referenced this pull request Jan 24, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
dscho added a commit that referenced this pull request Jan 25, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
dscho added a commit that referenced this pull request Jan 25, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
dscho added a commit that referenced this pull request Jan 25, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
dscho added a commit that referenced this pull request Jan 25, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
@jeffhostetler jeffhostetler deleted the jeffhostetler/quick_add_index_entry branch January 25, 2017 20:01
dscho added a commit to dscho/git that referenced this pull request Feb 1, 2017
…er/quick_add_index_entry

read-cache: speed up add_index_entry during checkout
dscho added a commit that referenced this pull request Feb 2, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
git-for-windows-ci pushed a commit that referenced this pull request Mar 21, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
dscho added a commit that referenced this pull request Mar 22, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
git-for-windows-ci pushed a commit that referenced this pull request Mar 23, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
git-for-windows-ci pushed a commit that referenced this pull request Mar 24, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
dscho added a commit that referenced this pull request Mar 24, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
git-for-windows-ci pushed a commit that referenced this pull request Mar 24, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
git-for-windows-ci pushed a commit that referenced this pull request Mar 25, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
dscho added a commit that referenced this pull request Mar 26, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
git-for-windows-ci pushed a commit that referenced this pull request Mar 27, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
git-for-windows-ci pushed a commit that referenced this pull request Mar 27, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
git-for-windows-ci pushed a commit that referenced this pull request Mar 28, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
dscho added a commit that referenced this pull request Mar 30, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
git-for-windows-ci pushed a commit that referenced this pull request Mar 30, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
git-for-windows-ci pushed a commit that referenced this pull request Mar 30, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
git-for-windows-ci pushed a commit that referenced this pull request Mar 30, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
dscho added a commit that referenced this pull request Apr 2, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
git-for-windows-ci pushed a commit that referenced this pull request Apr 12, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
dscho added a commit that referenced this pull request Apr 12, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
git-for-windows-ci pushed a commit that referenced this pull request Apr 13, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
git-for-windows-ci pushed a commit that referenced this pull request Apr 13, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
dscho added a commit that referenced this pull request Apr 16, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
git-for-windows-ci pushed a commit that referenced this pull request Apr 17, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
git-for-windows-ci pushed a commit that referenced this pull request Apr 17, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
git-for-windows-ci pushed a commit that referenced this pull request Apr 17, 2017
…dex_entry

read-cache: speed up add_index_entry during checkout
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