github GitoxideLabs/gitoxide gix-zlib-v0.4.0
gix-zlib v0.4.0

7 hours ago

New Features

  • move the sirocco feature to sirocco 0.2
    sirocco 0.2 decodes into a buffer the caller owns, in one call or many,
    so it now handles all zlib decompression with the feature, with no
    fallback to zlib-rs:

    • Inflate::once() and Inflate::prefix() decode with sirocco. A
      short output buffer gets sirocco's partial output.
    • The new Inflate::rest() continues the stream prefix() started, which
      loose objects use for their bodies instead of Inflate::state.
      Without the feature it continues with zlib-rs as before.
    • stream::inflate::Measure uses sirocco::inflate::Scanner.

    sirocco's errors map to the classes and messages zlib-rs produces,
    corruption as "Invalid input data" and a preset dictionary as a
    validation error.

  • add the sirocco feature to decompress with sirocco
    sirocco is a pure-Rust DEFLATE/zlib decompressor that is faster than zlib-rs
    on whole buffers, and can find where a stream ends without producing its output.
    With the feature enabled:

    • Inflate::once() decodes whole streams with sirocco, and falls back to zlib-rs
      on any error, so partial output, statuses and errors stay what they were.
    • The new Inflate::prefix() always uses zlib-rs, for callers that only want the
      start of a stream: the delta-size probe in gix-pack and the loose object header.
    • The new stream::inflate::Measure finds the compressed and decompressed size of a
      stream read from a BufRead. BytesToEntriesIter uses it instead of decompressing
      into io::sink(). With sirocco, the decompressed bytes aren't produced, so the
      Adler-32 checksum isn't checked in that pass; the delta-resolution pass of index
      creation still decodes and checks every object.

    zlib-rs is still used for everything else, including all compression.

    The gix crate exposes it as zlib-sirocco, and the fast feature of gitoxide
    enables it for the gix and ein binaries. sirocco requires Rust 1.89.

Changed (BREAKING)

  • hide the Inflate backend and align stream lifecycles
    Spend a lot of time with this one and massaged it into place, overall simplifying
    a little and adding test-coverage (that I am sure is already in Sirocco but doppelt
    haelt besser).

    The public Inflate::state field exposed a zlib-rs decoder even when
    sirocco handled all decoding. Make backend state private and retain only
    the selected implementation, avoiding an unused zlib-rs allocation when
    sirocco is enabled.

Commit Statistics

  • 7 commits contributed to the release over the course of 14 calendar days.
  • 14 days passed between releases.
  • 3 commits were understood as conventional.
  • 0 issues like '(#ID)' were seen in commit messages

Commit Details

view details
  • Uncategorized
    • Merge pull request #3065 from srijs/claude/project-thread-kr3hdl (0a49d46)
    • Hide the Inflate backend and align stream lifecycles (0ed7c8c)
    • Move the sirocco feature to sirocco 0.2 (2b4faf9)
    • Add the sirocco feature to decompress with sirocco (95a0b14)
    • Merge pull request #3053 from GitoxideLabs/various-improvements (2d8dcc4)
    • Release gix-error v0.5.1, gix-utils v0.5.1 (6d1b686)
    • Merge pull request #3048 from GitoxideLabs/new-release (5fccccf)

Don't miss a new gitoxide release

NewReleases is sending notifications on new releases.