Skip to content

Commit 2ebf577

Browse files
committed
update mixed weights
1 parent cec70d6 commit 2ebf577

4 files changed

Lines changed: 109 additions & 28 deletions

File tree

site/content/docs/add-framework/test-profiles/h1/mixed.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@ Raw requests per second is not a fair metric for mixed workloads because differe
3939
The mixed score weights each request by its computational cost:
4040

4141
```
42-
weighted = baseline × 0.1 + json × 1 + db × 15 + upload × 15 + compression × 8
42+
weighted = baseline × 0.15 + json × 1 + db × 10 + upload × 10 + compression × 7
4343
score = (weighted / max(weighted)) × 100
4444
```
4545

4646
| Request type | Weight | Rationale |
4747
|-------------|--------|-----------|
48-
| Baseline | 0.1 | Trivial — parse query params, add integers, return 2 bytes |
48+
| Baseline | 0.15 | Trivial — parse query params, add integers, return 2 bytes |
4949
| JSON | 1 | Moderate — iterate 50 items, compute fields, serialize ~10 KB |
50-
| DB | 15 | Heavy — SQLite range query, parse tags, build JSON response |
51-
| Upload | 15 | Heavy — receive 1 MB body, return byte count, memory management |
52-
| Compression | 8 | Heavy — gzip-compress ~1 MB response on the fly |
50+
| DB | 10 | Heavy — SQLite range query, parse tags, build JSON response |
51+
| Upload | 10 | Heavy — receive 1 MB body, return byte count, memory management |
52+
| Compression | 7 | Heavy — gzip-compress ~1 MB response on the fly |
5353

5454
The framework with the highest weighted total scores **100**, others scale proportionally.
5555

site/content/docs/scoring/composite-score.md

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,34 @@ Frameworks that don't participate in a scored profile receive 0 for that profile
3434

3535
Not all profiles count toward the composite score. Profiles marked as **scored** contribute to the composite. Reference-only profiles (marked with **\***) are displayed for comparison but do not affect the ranking.
3636

37-
| Profile | Protocol | Scored | Workload |
38-
|---|---|---|---|
39-
| Baseline | HTTP/1.1 | Yes | Mixed GET/POST with query parsing |
40-
| Pipelined | HTTP/1.1 | No (*) | 16 requests batched per connection |
41-
| Short-lived | HTTP/1.1 | Yes | Connections closed after 10 requests |
42-
| JSON | HTTP/1.1 | Yes | Dataset processing and serialization |
43-
| Baseline | HTTP/2 | Yes | Query parsing over TLS with multiplexed streams |
44-
| Static | HTTP/2 | Yes | 20 static files served over TLS with multiplexed streams |
45-
| Baseline | HTTP/3 | Yes | Query parsing over QUIC (UDP) with TLS 1.3 |
46-
| Static | HTTP/3 | Yes | 20 static files served over QUIC (UDP) with TLS 1.3 |
47-
48-
Pipelined is reference-only because not all frameworks support HTTP pipelining.
37+
### HTTP/1.1
38+
39+
| Profile | Scored | Workload |
40+
|---|---|---|
41+
| Baseline | Yes | Mixed GET/POST with query parsing |
42+
| Short-lived | Yes | Connections closed after 10 requests |
43+
| JSON | Yes | Dataset processing and serialization |
44+
| Upload | Yes | 20 MB body ingestion, return byte count |
45+
| Compression | Yes | ~1 MB gzip-compressed JSON response |
46+
| Mixed | Yes | Weighted mix of baseline, JSON, DB, upload, compression |
47+
| Pipelined | No (*) | 16 requests batched per connection |
48+
| Noisy | No (*) | Valid requests interleaved with malformed noise |
49+
50+
### HTTP/2
51+
52+
| Profile | Scored | Workload |
53+
|---|---|---|
54+
| Baseline | Yes | Query parsing over TLS with multiplexed streams |
55+
| Static | Yes | 20 static files served over TLS with multiplexed streams |
56+
57+
### HTTP/3
58+
59+
| Profile | Scored | Workload |
60+
|---|---|---|
61+
| Baseline | Yes | Query parsing over QUIC (UDP) with TLS 1.3 |
62+
| Static | Yes | 20 static files served over QUIC (UDP) with TLS 1.3 |
63+
64+
Pipelined and Noisy are reference-only because not all frameworks support HTTP pipelining, and noisy traffic handling varies too widely to be fairly scored.
4965

5066
## Resource efficiency factors
5167

site/layouts/shortcodes/leaderboard-composite.html

Lines changed: 73 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,46 @@
6666
html.dark .composite-type-filter[data-type="engine"].active { color:#fbbf24; border-color:#f59e0b; background:rgba(245,158,11,0.12); }
6767
</style>
6868

69-
<div class="lb-filters composite-profiles-wrap" style="margin:0.5rem 0 0 0; padding:0.75rem 1rem; background:rgba(0,0,0,0.04); border-radius:8px; border:1px solid rgba(0,0,0,0.08);">
70-
<span class="lb-filters-label">Tests</span>
71-
<span class="lb-filters-hint">(Toggle)</span>
72-
<div class="composite-profile-filter active" data-profile="all">All</div>
73-
{{ range $profiles }}
74-
<div class="composite-profile-filter cp-{{ .proto }} active" data-profile="{{ .id }}">{{ .label }} <span style="font-size:0.65rem; color:#94a3b8;">({{ .sublabel }})</span></div>
75-
{{ end }}
69+
<div class="composite-profiles-wrap" style="margin:0.5rem 0 0 0; padding:0.75rem 1rem; background:rgba(0,0,0,0.04); border-radius:8px; border:1px solid rgba(0,0,0,0.08); display:flex; flex-direction:column; gap:0.5rem;">
70+
<div class="lb-filters" style="margin:0; padding:0;">
71+
<span class="lb-filters-label">Tests</span>
72+
<span class="lb-filters-hint">(Toggle)</span>
73+
<div class="composite-profile-filter active" data-profile="all">All</div>
74+
</div>
75+
<div class="lb-filters" style="margin:0; padding:0;">
76+
<span class="composite-proto-label composite-proto-toggle active" data-proto="h1">HTTP/1.1</span>
77+
{{ range $profiles }}{{ if eq .proto "h1" }}
78+
<div class="composite-profile-filter cp-{{ .proto }} active" data-profile="{{ .id }}">{{ .label }}</div>
79+
{{ end }}{{ end }}
80+
</div>
81+
<div class="lb-filters" style="margin:0; padding:0;">
82+
<span class="composite-proto-label composite-proto-toggle active" data-proto="h2">HTTP/2</span>
83+
{{ range $profiles }}{{ if eq .proto "h2" }}
84+
<div class="composite-profile-filter cp-{{ .proto }} active" data-profile="{{ .id }}">{{ .label }}</div>
85+
{{ end }}{{ end }}
86+
</div>
87+
<div class="lb-filters" style="margin:0; padding:0;">
88+
<span class="composite-proto-label composite-proto-toggle active" data-proto="h3">HTTP/3</span>
89+
{{ range $profiles }}{{ if eq .proto "h3" }}
90+
<div class="composite-profile-filter cp-{{ .proto }} active" data-profile="{{ .id }}">{{ .label }}</div>
91+
{{ end }}{{ end }}
92+
</div>
7693
</div>
7794
<style>
95+
.composite-proto-label { font-size:0.7rem; font-weight:700; letter-spacing:0.04em; text-transform:uppercase; align-self:center; }
96+
.composite-proto-toggle { cursor:pointer; user-select:none; padding:0.25rem 0.6rem; border-radius:5px; border:1.5px solid #e2e8f0; color:#94a3b8; background:transparent; transition:all 0.15s ease; }
97+
.composite-proto-toggle:hover { transform:translateY(-1px); box-shadow:0 2px 4px rgba(0,0,0,0.08); color:#475569; border-color:#cbd5e1; }
98+
.composite-proto-toggle.active[data-proto="h1"] { color:#3b82f6; border-color:#3b82f6; background:rgba(59,130,246,0.06); }
99+
.composite-proto-toggle.active[data-proto="h2"] { color:#d97706; border-color:#d97706; background:rgba(217,119,6,0.06); }
100+
.composite-proto-toggle.active[data-proto="h3"] { color:#16a34a; border-color:#16a34a; background:rgba(22,163,74,0.06); }
101+
.composite-proto-toggle.active[data-proto="h1"]:hover { background:rgba(59,130,246,0.12); }
102+
.composite-proto-toggle.active[data-proto="h2"]:hover { background:rgba(217,119,6,0.12); }
103+
.composite-proto-toggle.active[data-proto="h3"]:hover { background:rgba(22,163,74,0.12); }
104+
html.dark .composite-proto-toggle { color:#64748b; border-color:#334155; }
105+
html.dark .composite-proto-toggle:hover { color:#94a3b8; border-color:#475569; }
106+
html.dark .composite-proto-toggle.active[data-proto="h1"] { color:#60a5fa; border-color:#3b82f6; background:rgba(59,130,246,0.12); }
107+
html.dark .composite-proto-toggle.active[data-proto="h2"] { color:#fbbf24; border-color:#d97706; background:rgba(217,119,6,0.12); }
108+
html.dark .composite-proto-toggle.active[data-proto="h3"] { color:#4ade80; border-color:#16a34a; background:rgba(22,163,74,0.12); }
78109
.composite-profile-filter { padding:0.3rem 0.75rem; font-size:0.8rem; font-weight:500; color:#94a3b8; cursor:pointer; border-radius:6px; border:1.5px solid #e2e8f0; background:transparent; transition:all 0.15s ease; user-select:none; }
79110
.composite-profile-filter:hover { color:#475569; border-color:#cbd5e1; transform:translateY(-1px); box-shadow:0 2px 4px rgba(0,0,0,0.08); }
80111
.composite-profile-filter[data-profile="all"].active { color:#8b5cf6; border-color:#8b5cf6; background:rgba(139,92,246,0.06); font-weight:600; }
@@ -297,7 +328,7 @@
297328
});
298329

299330
// For mixed: compute weighted scores and re-normalize
300-
var mixedWeights = {baseline:0.1, json:1, db:15, upload:15, compression:8};
331+
var mixedWeights = {baseline:0.15, json:1, db:10, upload:10, compression:7};
301332
if (activeIds.indexOf('mixed') >= 0) {
302333
var maxWeighted = 0;
303334
Object.keys(avgTplMixed).forEach(function(fw) {
@@ -539,6 +570,17 @@
539570
// Initial render
540571
renderComposite();
541572

573+
// Sync proto toggle active state based on child profile filters
574+
function syncProtoToggles() {
575+
document.querySelectorAll('.composite-proto-toggle').forEach(function(pt) {
576+
var proto = pt.dataset.proto;
577+
var groupFilters = document.querySelectorAll('.composite-profile-filter.cp-' + proto);
578+
var anyActive = Array.prototype.some.call(groupFilters, function(f) { return f.classList.contains('active'); });
579+
if (anyActive) pt.classList.add('active');
580+
else pt.classList.remove('active');
581+
});
582+
}
583+
542584
// Profile filter click handlers
543585
document.querySelectorAll('.composite-profile-filter').forEach(function(btn) {
544586
btn.addEventListener('click', function() {
@@ -556,6 +598,29 @@
556598
allFilters.forEach(function(f) { f.classList.add('active'); });
557599
}
558600
}
601+
syncProtoToggles();
602+
renderComposite();
603+
});
604+
});
605+
606+
// Protocol group toggle handlers
607+
document.querySelectorAll('.composite-proto-toggle').forEach(function(btn) {
608+
btn.addEventListener('click', function() {
609+
var proto = btn.dataset.proto;
610+
var groupFilters = document.querySelectorAll('.composite-profile-filter.cp-' + proto);
611+
var allActive = Array.prototype.every.call(groupFilters, function(f) { return f.classList.contains('active'); });
612+
groupFilters.forEach(function(f) {
613+
if (allActive) f.classList.remove('active');
614+
else f.classList.add('active');
615+
});
616+
var allBtn = document.querySelector('.composite-profile-filter[data-profile="all"]');
617+
allBtn.classList.remove('active');
618+
var total = document.querySelectorAll('.composite-profile-filter[data-profile]:not([data-profile="all"])').length;
619+
var active = document.querySelectorAll('.composite-profile-filter[data-profile]:not([data-profile="all"]).active').length;
620+
if (active === 0 || active === total) {
621+
document.querySelectorAll('.composite-profile-filter').forEach(function(f) { f.classList.add('active'); });
622+
}
623+
syncProtoToggles();
559624
renderComposite();
560625
});
561626
});

site/layouts/shortcodes/leaderboard.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,7 +1212,7 @@
12121212
var mixedColors = {baseline:'#3b82f6', json:'#8b5cf6', db:'#f59e0b', upload:'#10b981', compression:'#ef4444'};
12131213
var mixedLabels = {baseline:'Baseline', json:'JSON', db:'DB', upload:'Upload', compression:'Gzip'};
12141214
var mixedKeys = ['baseline','json','db','upload','compression'];
1215-
var mixedWeights = {baseline:0.1, json:1, db:15, upload:15, compression:8};
1215+
var mixedWeights = {baseline:0.15, json:1, db:10, upload:10, compression:7};
12161216

12171217
var mixedGrid = '2.5rem 10rem 5.5rem 4.5rem 4.5rem 3.5rem 6rem 5rem 3.5rem 5rem 4.5rem 5.5rem 5rem 5rem 4rem';
12181218

@@ -1275,7 +1275,7 @@
12751275
barHeader.className = 'lb-mix-header';
12761276
barHeader.style.textAlign = 'right';
12771277
barHeader.style.fontWeight = '600';
1278-
barHeader.title = 'Weighted score: baseline\u00d70.1 + json\u00d71 + db\u00d715 + upload\u00d715 + gzip\u00d78, normalized to 100';
1278+
barHeader.title = 'Weighted score: baseline\u00d70.15 + json\u00d71 + db\u00d710 + upload\u00d710 + gzip\u00d77, normalized to 100';
12791279
barHeader.textContent = 'Score';
12801280
/* Insert mix legend header after Score */
12811281
var mixHeader = document.createElement('div');
@@ -1366,7 +1366,7 @@
13661366
barHeader.className = 'lb-mix-header';
13671367
barHeader.style.textAlign = 'right';
13681368
barHeader.style.fontWeight = '600';
1369-
barHeader.title = 'Weighted score: baseline\u00d70.1 + json\u00d71 + db\u00d715 + upload\u00d715 + gzip\u00d78, normalized to 100';
1369+
barHeader.title = 'Weighted score: baseline\u00d70.15 + json\u00d71 + db\u00d710 + upload\u00d710 + gzip\u00d77, normalized to 100';
13701370
barHeader.textContent = 'Score';
13711371
var mixHeader = document.createElement('div');
13721372
mixHeader.innerHTML = '<div style="font-size:0.65rem;font-weight:600;margin-bottom:1px;">Request Mix</div>' +

0 commit comments

Comments
 (0)