Skip to content

v0.5.2 — Performance, docs & CI hardening patch

Choose a tag to compare

@LarsArtmann LarsArtmann released this 22 Jul 02:02
· 165 commits to master since this release

No API break, no on-disk format change, no new dependency. Drop-in upgrade from v0.5.1.

cargo update -p segment-buffer

Performance

  • flush() now recycles the unflushed Vec capacity across flushes. Previously std::mem::take left the field at zero capacity, forcing the next batch through ~log2(N) reallocs. The new path reserves the previous batch's capacity inside the same lock scope — one upfront allocation replaces incremental growth. No public API change, no change to the concurrency contract.
  • Performance tuning guide (docs/PERFORMANCE.md § "Tuning for your workload"). Surfaces the four config-only Tier 0 levers (DurabilityPolicy, FlushPolicy, compression_level, for_each_from) in impact order, each with a code snippet and a "when NOT to use" guardrail.
  • examples/background_flush.rs — the recommended pattern for p99-sensitive producers: FlushPolicy::Manual + a caller-owned timer thread with an atomic shutdown flag and a final synchronous flush before exit.

Documentation

  • README expansion: Cargo features table (default = [], encryption, loom, fuzz), append_all one-liner in Quickstart, iter_from example next to the drain loop, open_with_report crash-recovery example.
  • SegmentBuffer rustdoc: new # Concurrency section (MPMC semantics, single-process flock invariant, mutex-never-held-across-I/O rule, loom-proven delete_acked + append interleaving, re-entrancy panic). Added #[doc(alias = "queue" | "spool" | "wal" | "writeahead" | "log")] for search discoverability. Cross-linked all examples/*.rs from the crate-root rustdoc.

CI / tooling

  • actionlint step added to scripts/verify-gate.sh and a matching job in ci.yml.
  • lychee redirect URLs documented in .github/lychee.toml (idiomatic docs.rs patterns that look like errors but aren't).
  • Historical doc annotations: 12 of 23 docs/{status,planning,perf}/2026-07-2* files annotated with non-destructive resolution notes (inline corrections for stale claims, end-of-file appendices for completed TODO items).

Verification

All gates green on commit 512d74a:

  • cargo fmt --all -- --check
  • cargo clippy --all-targets --features encryption -- -D warnings
  • cargo test --no-fail-fast --features encryption
  • cargo doc --no-deps --features encryption
  • cargo publish --dry-run --features encryption
  • CI + Nix workflows: success (verified via gh run list)