rad experiment show cd889d4a853c3e9a139da70460bd41dfa7097e58
by ee@did:key:z6MkvsiybCuk1WDZhh2aXDx7NTiZejKgWZygMNsUuXDMNvVQ · Apr 11 15:03 2026
swap repo.remotes() for repo.references() in branches_count
Measurements
Metric
BaselineThe benchmark measurement of the unmodified code
CandidateThe code with the proposed optimization applied
DeltaThe performance change from baseline to candidate
index_page_latency (ms)primary
1546.931 ms (n=1)
298.767 ms (n=1)
-80.68%
index_page_bytes (bytes)secondary
83287.000 bytes (n=1)
83284.000 bytes (n=1)
0.00%
Annotations
hypothesis
repo.remotes() loads signed refs per peer via signature verification; repo.references() skips that and returns the same per-peer (refname, tip_oid) pairs via libgit2 ref walk
profile_signal
diagnostic iteration proved 86% of index_page_inner time was inside repo.remotes() iterator .next() calls — not config_at_commit (16ms) or is_ancestor_of (14ms). That ruled out the iter-1 cache hypothesis and pointed directly here.
what_worked
branches_count latency went from ~1350ms to effectively free. Overall index render 1546.9 -> 298.8 ms (-80.7%, 5.2x). Variance collapsed too (std 7.9ms -> 0.99ms).
Base CommitThe starting commit before the optimization was applied