Skip to content

Commit 3478544

Browse files
toschmidtclaude
andcommitted
show individual hot/cold/load/storage ratios in the combined view
The Combined metric collapses load, data size, cold and hot into a single weighted-geomean "×N" score, which hides how a system earned it. In the Combined view, expand the score cell to also list the four component ratios that feed it: hot, cold, load and storage, each as the relative "×N" ratio (a component that doesn't apply to the system, e.g. cold for a lukewarm engine or load for a stateless one, shows "n/a"). Each ratio is padded to a fixed width with non-breaking spaces so the columns line up in the monospace cell (6 fits "×12.34" for hot/cold/load, 5 fits "×1.23" for storage), and the overall score is shown in bold. Other metric views are unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 3f87cf2 commit 3478544

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

index.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,8 +1042,26 @@ <h2>Detailed Comparison</h2>
10421042

10431043
const text = selectors.metric == 'load' ? (elem.load_time ? `${Math.round(elem.load_time)}s (×${ratio.toFixed(2)})` : 'stateless')
10441044
: selectors.metric == 'size' ? `${(elem.data_size / 1024 / 1024 / 1024).toFixed(2)} GiB (×${ratio.toFixed(2)})`
1045+
: selectors.metric == 'combined' ? (() => {
1046+
/// Break the combined score into the components it's built
1047+
/// from (hot, cold, load, storage) as the relative "×N"
1048+
/// ratios that feed the weighted score. Pad each to a fixed
1049+
/// width so the columns line up in the monospace cell.
1050+
const fmt = (v, n) => ((v == null || !isFinite(v)) ? 'n/a' : ${v.toFixed(2)}`).padStart(n, ' ');
1051+
const hot = fmt(relativeQueryTime(num_queries, baseline_data, elem, 'hot'), 6);
1052+
const cold = fmt(metricExcludes(elem, 'cold') ? null : relativeQueryTime(num_queries, baseline_data, elem, 'cold'), 6);
1053+
const load = fmt(metricExcludes(elem, 'load') ? null : elem.load_time / min_load_time, 6);
1054+
const size = fmt(metricExcludes(elem, 'size') ? null : elem.data_size / min_data_size, 5);
1055+
return `  (hot ${hot}, cold ${cold}, load ${load}, storage ${size})`;
1056+
})()
10451057
: ${ratio.toFixed(2)}`;
10461058

1059+
// Combined shows a bold overall score followed by the (plain) breakdown.
1060+
if (selectors.metric == 'combined') {
1061+
let score = document.createElement('strong');
1062+
score.appendChild(document.createTextNode(${ratio.toFixed(2)}`));
1063+
td_number.appendChild(score);
1064+
}
10471065
td_number.appendChild(document.createTextNode(text));
10481066

10491067
let td_bar = document.createElement('td');

0 commit comments

Comments
 (0)