Crate gix_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.

  • progress-unit-human-numbers — Provide human-readable numbers as well as easier to read byte units for progress bars.

  • progress-unit-bytes — Provide human readable byte units for progress bars.

  • fs-walkdir-parallel — If set, walkdir iterators will be multi-threaded.

  • fs-read-dir — Provide utilities suitable for working with the std::fs::read_dir().

  • tracing — Implement tracing with tracing-core, which provides applications with valuable performance details if they opt-in to it.

    Note that this may have overhead as well, thus instrumentations should be used stategically, only providing coarse tracing by default and adding details only where needed while marking them with the appropriate level.

  • tracing-detail — If enabled, detailed tracing is also emitted, which can greatly increase insights but at a cost.

  • 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.

  • once_cell — If enabled, OnceCell will be made available for interior mutability either in sync or unsync forms.

  • 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.

  • crc32 — provide a proven and fast crc32 implementation.

§Mutually Exclusive ZLIB

  • zlib — Enable the usage of zlib related utilities to compress or decompress data. The base zlib feature uses the flate2 Rust crate; the other mutually exclusive features select the flate2 backend. Note that a competitive Zlib implementation is critical to gitoxide’s` object database performance. Enabling this without enabling one of the other features below will use a low-performance pure-Rust backend.
  • zlib-ng — Use the C-based zlib-ng backend, which can compress and decompress significantly faster.
  • zlib-ng-compat — Use zlib-ng via its zlib-compat API. Useful if you already need zlib for C code elsewhere in your dependencies. Otherwise, use zlib-ng.
  • 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 — Pure Rust backend, available for completeness even though it’s the default if neither of the above options are set. Low performance, but pure Rust, so it may build in environments where other backends don’t.

§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

Re-exports§

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