feat: add benchmarks, justfile, optimize throughput, harden quality gates

Benchmarking & comparison:
- Add criterion benchmarks (ucobs vs cobs 0.3 vs corncobs 0.1)
- Add Python cobs benchmark script
- Add performance comparison section to README with full results

Performance:
- Rewrite encode to scan-and-bulk-copy via copy_from_slice
- Rewrite decode to bulk-copy via copy_from_slice
- ~2-4x throughput improvement; now matches corncobs on most workloads

Quality hardening:
- Add #![forbid(unsafe_code)], #![warn(missing_docs)], #[must_use]
- Add [lints.rust] unsafe_code = "forbid" in Cargo.toml
- Add rust-version (MSRV) = "1.56"
- Add docs.rs metadata
- 106 tests: 80 unit/corpus + 25 property tests (25k cases each = 625k total)
- External test vectors from: Wikipedia, Cheshire & Baker paper, nanocobs,
  cobs-c, cobs2-rs, Jacques Fortier, Python cobs package
- Add fuzz_small_dest fuzz target (encode/decode with undersized buffers)
- Improve doc examples to show sentinel append/strip convention

Infrastructure:
- Add justfile with test (nextest), check, bench, fuzz, miri, fmt targets
- cargo-nextest for parallel test execution
- Update .gitignore for Python cache files

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Opus 4.6 committed 2026-03-30 17:19:12 -06:00
1 parent 08063391e8
commit a5e3e5f63b
10 files changed
+1187 -99

No files matched your search

+13
View File
@@ -2,6 +2,7 @@
name = "ucobs"
version = "0.1.0"
edition = "2021"
rust-version = "1.56"
license = "MIT"
description = "μCOBS — Consistent Overhead Byte Stuffing. no_std, zero-alloc, fastest, most-tested COBS implementation."
authors = ["Stephen Waits <steve@waits.net>"]
@@ -15,7 +16,19 @@ categories = ["encoding", "no-std::no-alloc", "embedded"]
[features]
default = []
[lints.rust]
unsafe_code = "forbid"
[package.metadata.docs.rs]
all-features = true
[dev-dependencies]
cobs = "0.3"
corncobs = "0.1"
criterion = { version = "0.5", features = ["html_reports"] }
proptest = "1"
rand = "0.8"
[[bench]]
name = "bench"
harness = false