Crate git_features
source ·Expand description
A crate providing foundational capabilities to other git-*
crates with trade-offs between compile time, binary size or speed
selectable using cargo feature toggles.
It’s designed to allow the application level crate to configure feature toggles, affecting all other git-*
crates using
this one.
Thus all features provided here commonly have a ‘cheap’ base implementation, with the option to pull in counterparts with higher performance.
Feature Flags
-
progress
— Provide traits and utilities for providing progress information. These can then be rendered using facilities of theprodash
crate. -
fs-walkdir-parallel
— If set, walkdir iterators will be multi-threaded. -
parallel
— Use scoped threads and channels to parallelize common workloads on multiple objects. If enabled, it is used everywhere where it makes sense. As caches are likely to be used and instantiated per thread, more memory will be used on top of the costs for threads. Thethreading
module will contain thread-safe primitives for shared ownership and mutation, otherwise these will be their single threaded counterparts. This way, single-threaded applications don’t have to pay for threaded primitives. -
crc32
— provide a proven and fastcrc32
implementation.
Mutually Exclusive ZLIB
-
zlib
— Enable the usage of zlib related utilities to compress or decompress data. By default it uses a pure rust implementation which is slower than the zlib-ng-compat or zlib-stock versions, but might be relevant if you prefer a pure-rust build and reduced performance is acceptable. zlib-stock can be used if dynamic linking of an external zlib library is desired or if cmake is not available. Note that a competitive Zlib implementation is critical togitoxide's
object database performance. Additional backends are supported, each of which overriding the default Rust backend. -
zlib-ng
— Use zlib-ng (libz-ng-sys) with native API (no compat mode) that can co-exist with system libz. -
zlib-ng-compat
— Use a C-based backend which can compress and decompress significantly faster than the other options. -
zlib-stock
— Use a slower C-based backend which can compress and decompress significantly faster than the rust version. Unlikezlib-ng-compat
, this allows using dynamic linking with systemzlib
libraries and doesn’t require cmake. -
zlib-rust-backend
— available for completeness even though it’s the default - it may be chosen for more specific feature flag names, instead of a barezlib
.
Mutually Exclusive SHA1
-
fast-sha1
— A fast SHA1 implementation is critical togitoxide's
object database performance A multi-crate implementation that can use hardware acceleration, thus bearing the potential for up to 2Gb/s throughput on CPUs that support it, like AMD Ryzen or Intel Core i3, as well as Apple Silicon like M1. Takes precedence overrustsha1
if both are specified. -
rustsha1
— A standard and well performing pure Rust implementation of Sha1. Will significantly slow down various git operations.
Other
cache-efficiency-debug
— Count cache hits and misses and print that debug information on drop. Caches implement this by default, which costs nothing unless this feature is enabled
Optional Dependencies
-
walkdir
— Makes facilities of thewalkdir
crate partially available. In conjunction with the parallel feature, directory walking will be parallel instead behind a compatible interface. -
once_cell
— If enabled, OnceCell will be made available for interior mutability either in sync or unsync forms.
Modules
io-pipe
io-pipe
feature toggle.parallel
feature toggle.progress
prodash
types along with various utilities for comfort.threading
feature toggle.zlib