Skip to content

Commit ad750fa

Browse files
authored
Merge pull request #922 from rylev/visual-bug
Remove visual bug of non-collapsing benches
2 parents 1da5203 + a4db1d0 commit ad750fa

File tree

1 file changed

+28
-16
lines changed

1 file changed

+28
-16
lines changed

site/static/compare.html

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,24 @@
164164
border: 1px solid;
165165
cursor: help;
166166
}
167+
168+
#benches tbody::before {
169+
content: '';
170+
display: block;
171+
height: 10px;
172+
}
173+
174+
#benches td {
175+
text-align: center;
176+
}
177+
178+
#benches th {
179+
border-right: dotted 1px;
180+
}
181+
182+
.benchmark-name {
183+
text-align: center;
184+
}
167185
</style>
168186
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
169187
</head>
@@ -302,21 +320,12 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
302320
</div>
303321
</fieldset>
304322
<div v-if="data" id="content" style="margin-top: 15px">
305-
<table class="compare" style="width: 80%; margin: 0 auto; font-size: medium !important;">
306-
<tbody>
307-
<template v-for="bench in benches">
308-
<tr data-field-start="true">
309-
<th>
310-
<details>
311-
<summary>{{ trimBenchName(bench.name) }}</summary>
312-
</details>
313-
</th>
314-
<td>min: <span v-bind:class="percentClass(bench.minPct)">{{bench.minPct}}%</span></td>
315-
<td>max: <span v-bind:class="percentClass(bench.maxPct)">{{bench.maxPct}}%</span></td>
316-
<td></td>
317-
</tr>
323+
<table id="benches" class="compare" style="width: 80%; margin: 0 auto; font-size: medium !important;">
324+
<template v-for="bench in benches">
325+
<tbody>
318326
<template v-for="run in bench.variants">
319327
<tr>
328+
<th v-if="run.index === 0" v-bind:rowspan="bench.variants.length"> {{bench.name}}</th>
320329
<td>{{ run.casename }}</td>
321330
<td>
322331
<a v-bind:href="detailedQueryLink(data.a.commit, bench.name, run.casename)">
@@ -338,8 +347,8 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
338347
</td>
339348
</tr>
340349
</template>
341-
</template>
342-
</tbody>
350+
</tbody>
351+
</template>
343352
</table>
344353
<br />
345354
<table class="compare" style="margin: auto;" v-if="data && Object.keys(data.a.bootstrap).length > 0">
@@ -352,7 +361,7 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
352361
<th v-if="bootstrapTotals.b">B: {{bootstrapTotals.b.toFixed(3)}}</th>
353362
</tr>
354363
<template v-for="bootstrap in bootstraps">
355-
<tr data-field-start="true">
364+
<tr>
356365
<th style="width: 19em;">{{bootstrap.name}}</th>
357366
<td v-if="bootstrap.a">{{bootstrap.a}}</td>
358367
<td v-if="bootstrap.b">{{bootstrap.b}}</td>
@@ -431,6 +440,7 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
431440
}
432441
function toVariants(name) {
433442
let variants = [];
443+
let index = 0;
434444
for (let d of data.a.data[name]) {
435445
const key = d[0];
436446
const datumA = d[1];
@@ -451,11 +461,13 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
451461
if (shouldShowBuild(key)) {
452462
variants.push({
453463
casename: key,
464+
index,
454465
datumA,
455466
datumB,
456467
percent,
457468
isDodgy,
458469
});
470+
index += 1;
459471
}
460472
}
461473

0 commit comments

Comments
 (0)