perf: decode rewrite, encode zeros optimization, iai-callgrind benchmarks (0.3.1)
Decode rewritten with shrinking-slice pattern (split_first/split_at) instead of index arithmetic. Decode zeros 14% faster, decode nonzero flips from 5% behind corncobs to 2% ahead, decode mixed closes to tied. Encode zeros fast path moved before split_at — now tied with cobs (was 6% behind). Code size reduced to 821B (was 869B). Replaced criterion with iai-callgrind for deterministic instruction-count benchmarks via Valgrind. Zero run-to-run variance. Expanded to 162 benchmarks across 9 sizes. ucobs now wins or ties 16 of 18 benchmarks vs corncobs and cobs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
9 files changed
+420
-217
No files matched your search
@@ -1,5 +1,28 @@
|
||||
# Changelog
|
||||
|
||||
## 0.3.1 — 2026-03-31
|
||||
|
||||
### Performance
|
||||
|
||||
- **Decode: rewritten with shrinking-slice pattern** — decode zeros is 14%
|
||||
faster (25,018 vs 29,114 instructions at 4 KB), decode nonzero flipped from
|
||||
5% behind corncobs to 2% ahead, decode mixed closed from 8% behind to tied.
|
||||
ucobs now wins or ties 16 of 18 benchmarks.
|
||||
- **Encode zeros: 6% faster** — zero fast path moved before `split_at` calls,
|
||||
eliminating per-byte overhead. Now tied with cobs (previously 6% behind).
|
||||
- **Code size reduced** — 821 B total (was 869 B). Encode 429 B, decode 392 B.
|
||||
|
||||
### Changed
|
||||
|
||||
- **Replaced criterion with iai-callgrind** — benchmarks now measure
|
||||
deterministic instruction counts via Valgrind instead of wall-clock time.
|
||||
Zero run-to-run variance. Requires `valgrind` installed.
|
||||
- **Expanded benchmark coverage** — 9 payload sizes (0–4096 B) × 3 patterns
|
||||
× 3 crates × encode/decode = 162 benchmarks, all running in ~2 minutes.
|
||||
- **Code size measurement** added to `just bench` via `just bench-size`.
|
||||
- **Mutation testing** added via `cargo-mutants` (`just test-mutants`).
|
||||
- Added `mise.toml` for dev tool management.
|
||||
|
||||
## 0.3.0 — 2026-03-31
|
||||
|
||||
### Performance
|
||||
|
||||
Reference in new issue
Block a user