-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
gitoxide progress bar fixes #11800
Merged
Merged
gitoxide progress bar fixes #11800
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot to ask in the previous PR review. Could you give me a pointer to how this configuration works?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
gix-features
crate contains all parts of an implementation that are changeable at compile-time with cargo features. Plumbing crates pull it in and if necessary, enable 'base' versions of the capabilities they need. Those are always pure-Rust implementations of algorithms likezlib
orSHA1
. Thegix-features
crate also contains primitives for parallelism and utilities to parallelize work.The
gix
crate as entry-point for application developers now pulls ingix-features
to enable typical features that add on top of the baseline, like enabling actual parallelism with threads, or better performing versions of core algorithms. This works because cargo-feature resolution will compilegix-features
only once and aggregate all features set by all crates that use it.Now,
cargo
has disabled default features forgix
and only re-enables a few ones. None of the features provided by thegix-features
crate are 'forwarded' in thegix
crate to avoid duplication, socargo
has to pull it in itself to get a chance to set the features it needs. For now, this is onlyparallel
to get parallel computation for everything. but it could also enable faster SHA1 or zlib implementations, but that would pull in more C - right nowgitoxide
is configured to be 'pure Rust' which should be most portable.You can try it yourself by commenting out the
gix-features-for-configuration-only …
line and fetch the crates index - it will be single-threaded then and quite a bit longer. It will still be faster than thegit2
version though as it's optimal, and doesn't do any unnecessary computation. It's quite neat to see that thegix_feature::parallel
functions also exist in API-compatible serial forms that work the same - those kick in whenparallel
is not set.I think @epage called it a 'cargo-features-hack', and that's certainly a fitting name as well 😁.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much! I didn't expect such a comprehensive explanation 😆. Really really useful!