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 the prodash 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. The threading 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 fast crc32 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 to gitoxide'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. Unlike zlib-ng-compat, this allows using dynamic linking with system zlib 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 bare zlib.

Mutually Exclusive SHA1

  • fast-sha1 — A fast SHA1 implementation is critical to gitoxide'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 over rustsha1 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 the walkdir 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

Filesystem utilities
Hash functions and hash utilities
Utilities to cause interruptions in common traits, like Read/Write and Iterator.
ioio-pipe
A unidirectional pipe for bytes, analogous to a unix pipe. Available with the io-pipe feature toggle.
Run computations in parallel, or not based the parallel feature toggle.
progressprogress
Various prodash types along with various utilities for comfort.
Type definitions for putting shared ownership and synchronized mutation behind the threading feature toggle.
zlibzlib