Skip to content

Add quick profile filter to compare page #1259

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 1 commit into from
Mar 29, 2022
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
91 changes: 89 additions & 2 deletions site/static/compare.html
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,67 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
<div class="section-heading">Filter</div>
<input id="filter" type="text" v-model="filter.name" />
</div>
<div class="section section-list-wrapper">
<div class="section-heading">
<div style="width: 160px;">
<span>Profiles</span>
<span class="tooltip">?
<span class="tooltiptext">
The different compilation profiles (check, debug, opt, doc).
</span>
</span>
</div>
</div>
<ul class="states-list">
<li>
<label>
<input type="checkbox" id="profile-check" v-model="filter.profile.check" />
<span class="cache-label">check</span>
</label>
<div class="tooltip">?
<span class="tooltiptext">
Check build that does not generate any code.
</span>
</div>
</li>
<li>
<label>
<input type="checkbox" id="profile-debug" v-model="filter.profile.debug" />
<span class="cache-label">debug</span>
</label>
<div class="tooltip">?
<span class="tooltiptext">
Debug build that produces unoptimized code.
</span>
</div>
</li>
<li>
<label>
<input type="checkbox" id="profile-opt"
v-model="filter.profile.opt" />
<span class="cache-label">opt</span>
</label>
<div class="tooltip">?
<span class="tooltiptext">
Release build that produces as optimized code as possible.
</span>
</div>
</li>
<li>
<label>
<input type="checkbox" id="profile-doc"
v-model="filter.profile.doc" />
<span class="cache-label">doc</span>
</label>
<div class="tooltip">?
<span class="tooltiptext">
Documentation build that produces HTML documentation site produced
by `rustdoc`.
</span>
</div>
</li>
</ul>
</div>
<div class="section section-list-wrapper">
<div class="section-heading">
<div style="width: 160px;">
Expand Down Expand Up @@ -638,6 +699,12 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
name: null,
showOnlySignificant: true,
filterVerySmall: true,
profile: {
check: true,
debug: true,
opt: true,
doc: true
},
scenario: {
full: true,
incrFull: true,
Expand Down Expand Up @@ -672,6 +739,20 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
const filter = this.filter;
const benchmarkMap = this.benchmarkMap;

function profileFilter(profile) {
if (profile === "check") {
return filter.profile.check;
} else if (profile === "debug") {
return filter.profile.debug;
} else if (profile === "opt") {
return filter.profile.opt;
} else if (profile === "doc") {
return filter.profile.doc;
} else {
return true;
}
}

function scenarioFilter(scenario) {
if (scenario === "full") {
return filter.scenario.full;
Expand Down Expand Up @@ -702,7 +783,14 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{

const magnitudeFilter = filter.filterVerySmall ? testCase.magnitude != "very small" : true;

return scenarioFilter(testCase.scenario) && categoryFilter(testCase.category) && significanceFilter && nameFilter && magnitudeFilter;
return (
profileFilter(testCase.profile) &&
scenarioFilter(testCase.scenario) &&
categoryFilter(testCase.category) &&
significanceFilter &&
nameFilter &&
magnitudeFilter
);
}

let testCases =
Expand Down Expand Up @@ -997,7 +1085,6 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
}
});


function toggleFilters(id, toggle) {
let styles = document.getElementById(id).style;
let indicator = document.getElementById(toggle);
Expand Down