What's Changed
Documentation
- MkDocs + Material docs site with an API reference (mkdocstrings), a guide (diffing, applying patches,
produce()/drafts, serialization, observ integration), and an internals section covering the list-diff algorithm, proxy design, and pointer semantics (#49) - Rewritten README pointing at the docs site
- Rewrite docs prose in a plainer style (#61)
Typing
- Full modern type hints (PEP 604 unions, builtin generics) checked with
tyin CI,OperationTypedDicts for patch shapes,py.typedmarker (#49, #50, #52)
Test hardening
- Hypothesis-based property tests for round-trip diff/apply/iapply/produce and pointer escaping, plus a vendored RFC 6902 conformance corpus (#51, #60)
CI & benchmarking
- Modernized workflows (pinned actions, uv caching, trimmed steps) (#47)
- Noise-robust benchmark guard: interleaved master/PR runs compared by fastest-vs-slowest median rather than a single noisy sample (#48)
Performance
- List diff rewritten from an O(m·n) DP table to Myers' O((m+n)·D) algorithm (#53)
produce()hot-path redesign: lazy path recording and epoch-based location memoization instead of eagerPointerallocation on every write (#54)- Micro-optimization passes across diff, apply/iapply, and the produce proxy call paths (#55, #56, #57)
Full Changelog: v0.3.12...v1.0.0
Benchmarks: 1.0.0 vs 0.3.12
Median times from 3 interleaved local runs per side (PYTHONHASHSEED=0, GC disabled), same methodology as CI's benchmark guard.
| Benchmark | 0.3.12 | 1.0.0 | Δ |
|---|---|---|---|
list_diff_medium[0.1] (Myers vs DP) |
340.4 ms | 1.85 ms | −99.5% |
list_diff_completely_different |
356.7 ms | 107.8 ms | −69.8% |
dict_diff_flat_500_keys |
328.3 µs | 148.8 µs | −54.7% |
set_diff_1000_elements |
87.4 µs | 60.7 µs | −30.5% |
produce_deep_leaf_writes[copy] |
216.8 µs | 133.5 µs | −38.4% |
produce_in_place_vs_copy_dict |
218.8 µs | 188.4 µs | −13.9% |
diff_dict_many_mutations |
1.46 ms | 1.19 ms | −18.3% |
apply_dict_many_ops |
839.8 µs | 788.1 µs | −6.2% |
The list-diff rewrite dominates: cases with large or scattered edit distance see order-of-magnitude wins, since the DP table's O(m·n) cost no longer applies. A handful of list_diff_similar_* benchmarks (many small localized edits already handled well by the prefix/suffix trim) show a mild regression instead — up to +19% — from Myers' bookkeeping overhead on inputs where the old approach had little left to do; this sits within the noise floor (10–30% run-to-run) and wasn't worth chasing further given the wins elsewhere. Everything else lands within a few percent either way.