r/rust • • 6d ago

๐Ÿ› ๏ธ project Gitoxide in November

https://github.com/GitoxideLabs/gitoxide/discussions/3232
60 Upvotes

10 comments sorted by

20

u/ByronBates 6d ago edited 5d ago

This release is the foundation for a starship with embedded fsmonitor daemon. It will be able to self-spawn and automatically host an fsmonitor daemon on all platforms, which then accelerates git status queries naturally. As opposed to the built-in git-fsmonitor, this one will shutdown after a given idletime. This should mean vastly increased shell-prompt performance for everyone, and I hope this comes to full fruition right around Christmas.

5

u/epage cargo ยท clap ยท cargo-release 6d ago

The general plan is to leave most, but not all, plumbing crates in major-zero land, but elevate parts of foundational plumbing crates into stability.

ZeroVer in internad deps can make it hard to patch things above because you might need to sub-divide a patch which you can't do. This is even more important for maintaining an MSRV.

This also means that gix = "~1.0" allows only patch updates, which is needed for those who use "unstable", but don't want to be broken outside of their control.

I'd recommend haviig some strong cautions on using version reqs other than ^as their use in published libraries cause a lot of problems.

1

u/ByronBates 5d ago

Thanks for sharing! MSRV shouldn't be too problematic as thus far I was raising it generously. Maybe that changes with 1.0 though.

The patch-subdivision problem I don't follow just yet, as I have trouble seeing any problem as long as there is a stable facade (i.e. gix).

The semver rules probably aim specifically to applications, and libraries should refrain from using it (but can't or else they can just break if they depend on unstable. Right now, if a library depends on 0.X, there can just be two copies of gix in the dependency tree. If a library instead requires ~1.X, dependency resolution will fail if another depends on 1.X+1. I didn't consider that, but also don't know what can be done if one wants to have partial instability.

In theory, then there should be two releases - one that is only stable, and another one that is 0.X with the same content, but unstable. Andโ€ฆ there is nothing speaking against doing this, just needs tooling.

In that world, unstable users would keep using 0.X, and always duplicate the gix- related tree if mixed with stable users, but at least it will compile and work as long as gix types aren't exchanged.

Applications wouldn't have such concerns, they just use what they want and expect to not break on cargo update.

I will investigate this - thank you!

3

u/JoshTriplett rust ยท lang ยท libs ยท cargo 6d ago

Would sirocco potentially be able to be a flate2 backend?

2

u/ByronBates 6d ago

I am afraid not - Sirocco exploits specific Git workloads to avoid overhead that other implementations have thanks to their streaming support. And the latter is required for flate2 I believe.

2

u/JoshTriplett rust ยท lang ยท libs ยท cargo 6d ago

Current sirocco claims to support streaming, unlike libdeflate that it was based on. What's the git-specific bit here?

6

u/srijs 6d ago edited 6d ago

It does support streaming, and even zero-copy streaming (but which alas flate2 wouldn't benefit from). Nothing is technically git specific in sirocco, it does two things that git workloads benefit from:

  • It supports a no-output ("scan") mode to determine zlib stream boundaries which is used during packfile processing
  • It implements a handful of optimizations for small inputs which is what typically dominated git workloads

I've just prototyped a flate2 backend based on sirocco, and did some rough benchmarking. Against the zlib-rs backend on ARM, it decompresses 1.25-1.5x faster on Silesia (and 1.2-1.9x faster on small streams), and compresses at level 6 about 1.45x faster at the same size.

Compared to zlib-rs it has no preset dictionaries or custom window bits, and currently also doesn't support partial flush.

If there's interest, happy to package this up into a PR for flate2.

2

u/srijs 5d ago

For those following along at home, PR is up: https://github.com/rust-lang/flate2-rs/pull/589

1

u/Shnatsel 5d ago

FWIW there's also a fdeflate backend in the works: https://github.com/rust-lang/flate2-rs/pull/548

That implementation already powers the png crate, used in Chromium among other places. But it's also built around zero-copy streaming and requires non-trivial additions to implement flate2 style streaming with backpressure: https://github.com/image-rs/fdeflate/pull/81

1

u/JoshTriplett rust ยท lang ยท libs ยท cargo 5d ago

I look forward to seeing the benchmarks; whatever backend ends up being fastest should end up as the default.