Skip to content

Add summary #927

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions site/static/compare.html
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,11 @@
.benchmark-name {
text-align: center;
}

.summary {
display: flex;
align-items: center;
}
</style>
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
</head>
Expand Down Expand Up @@ -341,6 +346,31 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
</div>
</fieldset>
<div v-if="data" id="content" style="margin-top: 15px">
<div style="display: flex; justify-content: space-evenly;">
<span style="font-weight: bold;">Summary:</span>
<span class="summary positive">
{{summary.numRegressed}}
<svg style="width:18px;height:18px" viewBox="0 0 24 24">
<path
d="M16,18L18.29,15.71L13.41,10.83L9.41,14.83L2,7.41L3.41,6L9.41,12L13.41,8L19.71,14.29L22,12V18H16Z">
</path>
</svg>
</span>
<span class="summary">
{{summary.numUnchanged}}
<svg style="width:18px;height:18px" viewBox="0 0 24 24">
<path d="M22,12L18,8V11H3V13H18V16L22,12Z"></path>
</svg>
</span>
<span class="summary negative">
{{summary.numImproved}}
<svg style="width:18px;height:18px" viewBox="0 0 24 24">
<path
d="M16,6L18.29,8.29L13.41,13.17L9.41,9.17L2,16.59L3.41,18L9.41,12L13.41,16L19.71,9.71L22,12V6H16Z">
</path>
</svg>
</span>
</div>
<table id="benches" class="compare">
<template v-for="bench in benches">
<tbody>
Expand Down Expand Up @@ -572,6 +602,37 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
},
stat() {
return findQueryParam("stat") || "instructions:u";
},
summary() {
let numRegressed = 0;
let numImproved = 0;
let numUnchanged = 0;
for (let name of Object.keys(this.data.a.data)) {
for (let d of this.data.a.data[name]) {
const run = d[0];
const datumA = d[1];
const datumB = this.data.b.data[name]?.find(x => x[0] == run)?.[1];
if (!datumB) {
continue;
}
let percent = 100 * ((datumB - datumA) / datumA);
const isDodgy = this.isDodgy(name, run);
const threshold = isDodgy ? 1.0 : 0.2;
if (percent > threshold) {
numRegressed += 1;
} else if (percent < -threshold) {
numImproved += 1;
} else {
numUnchanged += 1
}
}
}
return {
numRegressed,
numImproved,
numUnchanged,
}

}
},
methods: {
Expand Down Expand Up @@ -620,6 +681,14 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
}
return result;
},
isDodgy(name, run) {
let variance = this.data.variance;
if (!variance) {
return false;
}
variance = this.data.variance[name + "-" + run];
return (variance?.description?.type ?? "Normal") != "Normal";
}
},
});

Expand Down