Experiment: 204ed48
rad experiment show 204ed480a016f022fe608dc31a976e58b23e3242
by lftherioslftherios@did:key:z6MkupQHdQky5atyAu9zF8dUu1EavUjckDgCdZLH8y2W8teE · Apr 21 14:47 2026
fold visible_tip_oids into ticker pass; reuse repo name string
Measurements
MetricBaselineThe benchmark measurement of the unmodified codeCandidateThe code with the proposed optimization appliedCandidate/Parent ΔThe performance change from baseline to candidate
index_page_latency (ms) primary
median wall-clock latency of cc-httpd index_page_inner render (landing page HTML against local Radicle storage), measured over 15 iterations with 3 warmups
108.941 ms (n=1)108.434 ms (n=1)-0.46%
index_page_bytes secondary61347.000 (n=1)61341.000 (n=1)0.00%
Annotations
hypothesismerging the visible_tip_oids HashSet build into the ticker loop avoids a second pass over all_exps and one redundant ui_visible filter per experiment; reusing the already-computed name string for each ticker row drops a payload.name() call per ticker insert
what_workedsingle pass; 108.434ms vs 108.965ms baseline (-0.49%) — borderline noise but semantically cleaner
Base CommitThe starting commit before the optimization was applied1924e3031a7b8034e9bca0b39381809175cc95c0
Candidate CommitThe code with the proposed optimization applied438f3669345b62ddaeaca6750811672e67e6de44
Bench scripta28ada5e27a8
bench_cmd./bench/benchmark.sh
build_cmdcargo build --release -p cc-httpd
Schemav5
Diff
~ cc-httpd/src/html/index.rs
@@ -121,11 +121,6 @@ pub(crate) fn index_page_inner(
121 if all_exps.is_empty() { 122 continue; 123 } 124- let visible_tip_oids: std::collections::HashSet<_> = all_exps 125- .iter() 126- .filter(|(_, e)| ui_visible(e)) 127- .map(|(_, e)| e.oid) 128- .collect(); 124 125 let rid_short = urls::rid_path(&info.rid); 126 let name = payload.name().to_string();
@@ -139,10 +134,16 @@ pub(crate) fn index_page_inner(
134 .map(|(_, e)| MetricCatalog::load(&repo, &e.base, &e.oid)) 135 .unwrap_or_default(); 136 137+ // Single pass over all_exps: collect ui-visible experiment oids 138+ // (for the per-peer branch tip prefilter below) while simultaneously 139+ // counting experiments, reproductions, and building ticker rows. 140+ let mut visible_tip_oids: std::collections::HashSet<radicle::git::Oid> = 141+ std::collections::HashSet::with_capacity(all_exps.len()); 142 for (_id, exp) in &all_exps { 143 if !ui_visible(exp) { 144 continue; 145 } 146+ visible_tip_oids.insert(exp.oid); 147 experiment_count += 1; 148 reproduction_count += exp.reproductions.len(); 149
@@ -154,7 +155,7 @@ pub(crate) fn index_page_inner(
155 156 if primary.has_metric { 157 ticker_items.push(TickerItem { 157- repo_name: payload.name().to_string(), 158+ repo_name: name.clone(), 159 description: exp.description.clone().unwrap_or_default(), 160 delta_str: primary.delta_str, 161 improved: primary.is_improvement,
Environment
Archaarch64
OSDarwin 26.3.1
CPUApple M1 Max
Agentpi-autoresearch / pi
Filescc-httpd/src/html/index.rs