Skip to content

Commit 93a974c

Browse files
committed
Clean up
1 parent 89da799 commit 93a974c

File tree

1 file changed

+11
-42
lines changed

1 file changed

+11
-42
lines changed

site/static/compare.html

Lines changed: 11 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,8 @@ <h1>Comparing <span id="stat-header">instructions:u</span> between <span id="bef
235235
<div class="section-heading"><span>Show only significant changes</span>
236236
<span class="tooltip">?
237237
<span class="tooltiptext">
238-
Whether to filter out all benchmarks that do not show significant changes.
238+
Whether to filter out all benchmarks that do not show significant changes. A significant
239+
change is any change above 0.2% for non-noisy benchmarks and 1.0% for noisy ones.
239240
</span>
240241
</span>
241242
</div>
@@ -281,15 +282,13 @@ <h1>Comparing <span id="stat-header">instructions:u</span> between <span id="bef
281282
<template v-for="bench in benches">
282283
<tr data-field-start="true">
283284
<th>
284-
<details class="toggle-table" v-on:toggle="benchGroupToggle">
285+
<details>
285286
<summary>{{ trimBenchName(bench.name) }}</summary>
286287
</details>
287288
</th>
288-
<td>avg: <span v-bind:class="percentClass(bench.avgPct)">{{bench.avgPct}}</span></td>
289-
<td>min: <span v-bind:class="percentClass(bench.minPct)">{{bench.minPct}}</span></td>
290-
<td>max: <span
291-
v-bind:class="percentClass(bench.maxPct)">{{bench.maxPct}}%{{isDodgyBench(bench)
292-
? "?" : ""}}</span></td>
289+
<td>min: <span v-bind:class="percentClass(bench.minPct)">{{bench.minPct}}%</span></td>
290+
<td>max: <span v-bind:class="percentClass(bench.maxPct)">{{bench.maxPct}}%</span></td>
291+
<td></td>
293292
</tr>
294293
<template v-for="run in bench.variants">
295294
<tr>
@@ -403,6 +402,10 @@ <h1>Comparing <span id="stat-header">instructions:u</span> between <span id="bef
403402
const key = d[0];
404403
const datumA = d[1];
405404
const datumB = data.b.data[name].find(x => x[0] == key)[1];
405+
let percent = (100 * (datumB - datumA) / datumA).toFixed(1);
406+
if (percent === "-0.0") {
407+
percent = "0.0";
408+
}
406409

407410
let isDodgy = false;
408411
if (data.variance) {
@@ -414,7 +417,7 @@ <h1>Comparing <span id="stat-header">instructions:u</span> between <span id="bef
414417
casename: key,
415418
datumA,
416419
datumB,
417-
percent: (100 * (datumB - datumA) / datumA).toFixed(1),
420+
percent,
418421
isDodgy,
419422
});
420423
}
@@ -431,15 +434,12 @@ <h1>Comparing <span id="stat-header">instructions:u</span> between <span id="bef
431434
const pcts = variants.map(field => parseFloat(field.percent));
432435
const maxPct = Math.max(...pcts).toFixed(1);
433436
const minPct = Math.min(...pcts).toFixed(1);
434-
const sum = pcts.reduce((a, b) => a + b, 0);
435-
const avgPct = (sum / pcts.length).toFixed(1);
436437
const maxCasenameLen = Math.max(...variants.map(f => f.casename.length));
437438
return {
438439
name,
439440
variants,
440441
maxPct,
441442
minPct,
442-
avgPct,
443443
maxCasenameLen,
444444
};
445445
}).
@@ -499,10 +499,6 @@ <h1>Comparing <span id="stat-header">instructions:u</span> between <span id="bef
499499
percentLink(commit, baseCommit, bench, run) {
500500
return `/detailed-query.html?commit=${commit}&base_commit=${baseCommit}&benchmark=${bench}&run_name=${run}`;
501501
},
502-
benchGroupToggle(e) {
503-
const element = e.target;
504-
toggleBenchGroup(element);
505-
},
506502
formatDate(date) {
507503
date = new Date(date);
508504
function padStr(i) {
@@ -519,21 +515,7 @@ <h1>Comparing <span id="stat-header">instructions:u</span> between <span id="bef
519515
}
520516
return result;
521517
},
522-
isDodgyBench(bench) {
523-
return bench.variants.some(f => f.isDodgy);
524-
},
525518
},
526-
watch: {
527-
data(newVal, oldVal) {
528-
if (newVal && !oldVal) {
529-
this.$nextTick(() => {
530-
for (let element of document.querySelectorAll(".toggle-table")) {
531-
toggleBenchGroup(element);
532-
}
533-
});
534-
}
535-
}
536-
}
537519
});
538520

539521
function isSignificant(variant) {
@@ -546,19 +528,6 @@ <h1>Comparing <span id="stat-header">instructions:u</span> between <span id="bef
546528

547529
}
548530

549-
function toggleBenchGroup(element) {
550-
let next = element.parentElement.parentElement.nextElementSibling;
551-
let inBody = []
552-
while (next && next.getAttribute("data-field-start") !== "true") {
553-
if (element.open) {
554-
next.style.display = "";
555-
} else {
556-
next.style.display = "none";
557-
}
558-
next = next.nextElementSibling;
559-
}
560-
}
561-
562531
function toggleFilters(id, toggle) {
563532
let styles = document.getElementById(id).style;
564533
let indicator = document.getElementById(toggle);

0 commit comments

Comments
 (0)