Skip to content

Benchmark critical operations #302

Description

@mroczect

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).

Metadata

Metadata

Assignees

Labels

performanceSee issues with this label

Projects

Status
Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions