perf(sync): instrument and benchmark commit-staging latency

Break the stage+commit window into sub-phases (FAT working-tree walk vs
object writes) via `commit split —` log lines, and add two micro-benchmarks
(sd_bench for SD/FAT primitive ops, git_bench for libgit2 object overhead)
with justfile recipes. Documents the walk-vs-writes cost model in
tradeoff-curves/sync-commit-staging.md to decide whether explicit-path
staging over the editor's dirty set is worth replacing add_all(["*"]).
This commit is contained in:
Julien Calixte
2026-07-12 12:24:50 +02:00
parent beb11eda5e
commit 456c4c43e7
8 changed files with 520 additions and 5 deletions

View File

@@ -36,6 +36,22 @@ name = "sd_fat"
path = "src/bin/sd_fat.rs"
harness = false
# SD/FAT primitive-op micro-benchmark — attributes the ~700 ms/loose-object write
# floor (see docs/tradeoff-curves/sync-commit-staging.md). Pure SD, no git feature.
# Flash with `just flash-bench`.
[[bin]]
name = "sd_bench"
path = "src/bin/sd_bench.rs"
harness = false
# git-level micro-benchmark — localizes the ~700 ms/object libgit2 overhead (see
# docs/tradeoff-curves/sync-commit-staging.md). Needs the `git` feature.
[[bin]]
name = "git_bench"
path = "src/bin/git_bench.rs"
harness = false
required-features = ["git"]
# Spike 9 — boot splash. Standalone bench program that paints the Typoena
# wordmark-in-a-circle on the EPD. No git, no SD, no Wi-Fi. Flash with
# `just flash-splash`.