-
-
Notifications
You must be signed in to change notification settings - Fork 348
checkout: Create directories similar to and consider using a cache #343
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 tasks
The windows file check needs to handle relative links properly when checking for file type.
For now just with empty files, but that shows that with a single thread it's faster than git at 27k files per second created compared to 14.5k of a single thread of git. We do the least amount of work necessary even without an lstat cache, but that probably changes once we have to access the ODB to obtain actual data. Note that git might also do an additional exists check per file to see if it changed, something we don't do as we may assume exclusive access to the directory and just go with that for now. Long story short: it looks like there is a lot of potential for performance improvements and I think there is a lot of room for being faster especially in multi-threaded mode.
This should tell us how much time it really takes to do the ODB part, and see how much we could save by optimizing disk access, for instance by using an lstat cache.
Git is able to use relative paths by changing the working directory. See https://github.com/git/git/blob/main/builtin.h#L82:L82 We probably shouldn't do that as a library, but will compose the path instead like we do now, but should consider using the cache for file and directory handling to avoid allocations.
This comes at a cost, but hopefully this is justified performance wise but most importantly, makes the upcoming implementation of the lstat cache possible or easier.
We now definitely do extra work in some cases, but save a lot in others thanks to the sorted input.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A custom
crate_dir_all()
with a cache similar to how git does it.Tasks