Experiment: 0148858
rad experiment show 0148858a05cbfd1838c2b20f27e65b974ca9e358
by ee@did:key:z6MkvsiybCuk1WDZhh2aXDx7NTiZejKgWZygMNsUuXDMNvVQ · Apr 11 15:03 2026
pre-filter repos without experiment COB refs
Measurements
MetricBaselineThe benchmark measurement of the unmodified codeCandidateThe code with the proposed optimization appliedDeltaThe performance change from baseline to candidate
index_page_latency (ms) primary230.934 ms (n=1)215.218 ms (n=1)-6.80%
index_page_bytes (bytes) secondary83284.000 bytes (n=1)83284.000 bytes (n=1)0.00%
Annotations
hypothesis55% of seeded repos have no experiments; Experiments::open(repo).all() still pays to enumerate type refs per repo. libgit2 glob check is cheaper.
profile_signaldiagnostic showed 16/29 empty; the existence check is a single git reference_glob call.
what_worked-6.8% latency. Wins on empty repos were smaller than predicted — empty repos only cost ~1 ms each because Store::list short-circuits at empty types(). Still clear improvement and zero-risk.
Base CommitThe starting commit before the optimization was applied2a67cf54d0bc8bc2ce056adaca992502cd315476
Candidate CommitThe code with the proposed optimization appliedf2db696951e188a0c3e797d4aa227ac1547dc395
Configoptimize.yaml
Diff
~ cc-httpd/src/html.rs
@@ -2028,6 +2028,19 @@ pub(crate) fn index_page_inner(
2028 let Ok(payload) = doc.doc.project() else { 2029 continue; 2030 }; 2031+ // Skip repos with no experiment COBs before paying the cost of 2032+ // `Experiments::open(...).all()`, which walks the COB change graph 2033+ // for every experiment. On a seed serving many repos, over half may 2034+ // have zero experiments; the libgit2 glob check is ~free. 2035+ let has_any_experiment_cob = repo 2036+ .raw() 2037+ .references_glob("refs/namespaces/*/refs/cobs/cc.experiment/*") 2038+ .ok() 2039+ .map(|mut it| it.next().is_some()) 2040+ .unwrap_or(false); 2041+ if !has_any_experiment_cob { 2042+ continue; 2043+ } 2044 let experiments = match Experiments::open(&repo) { 2045 Ok(e) => e, 2046 Err(_) => continue,
Environment
Buildtrue
Teststrue
Archaarch64
OSDarwin 14.6.1
CPUApple M2
Agentpi-autoresearch / pi
Filescc-httpd/src/html.rs