Summary
Set up benchmarks using criterion to measure the performance of critical operations: hashing, encoding/decoding, and commit graph traversal.
Context
Performance is a key requirement for a version control system. Benchmarks will help identify regressions and guide optimizations.
Tasks
- Add
criterion as a dev-dependency to relevant crates.
- Create benchmark files (e.g.,
benches/hashing.rs, benches/codec.rs, benches/revwalk.rs).
- Benchmarks:
- Hashing: hash blobs of various sizes (1 KB, 1 MB, 10 MB) and compare throughput.
- Encoding/Decoding: round-trip a large tree and commit graph.
- RevWalk: traverse a synthetic graph with 10k+ commits using BFS and topological order.
- Ensure benchmarks can be run with
cargo bench.
- Document how to run benchmarks and interpret results.
- Optionally integrate benchmark comparison into CI (e.g., using
critcmp).
Acceptance Criteria
- Benchmarks exist and run successfully.
- At least one benchmark result is recorded as a baseline in the repository (e.g., in a
BENCHMARKS.md).
Dependencies
- Core and plumbing implementations (Fase 2 and 3).
Summary
Set up benchmarks using
criterionto measure the performance of critical operations: hashing, encoding/decoding, and commit graph traversal.Context
Performance is a key requirement for a version control system. Benchmarks will help identify regressions and guide optimizations.
Tasks
criterionas a dev-dependency to relevant crates.benches/hashing.rs,benches/codec.rs,benches/revwalk.rs).cargo bench.critcmp).Acceptance Criteria
BENCHMARKS.md).Dependencies