Skip to content

Commit 543a651

Browse files
authored
Merge pull request #1259 from rust-lang/compare-profile-filter
Add quick profile filter to compare page
2 parents fa82164 + 1d6b837 commit 543a651

File tree

1 file changed

+89
-2
lines changed

1 file changed

+89
-2
lines changed

site/static/compare.html

Lines changed: 89 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,67 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
361361
<div class="section-heading">Filter</div>
362362
<input id="filter" type="text" v-model="filter.name" />
363363
</div>
364+
<div class="section section-list-wrapper">
365+
<div class="section-heading">
366+
<div style="width: 160px;">
367+
<span>Profiles</span>
368+
<span class="tooltip">?
369+
<span class="tooltiptext">
370+
The different compilation profiles (check, debug, opt, doc).
371+
</span>
372+
</span>
373+
</div>
374+
</div>
375+
<ul class="states-list">
376+
<li>
377+
<label>
378+
<input type="checkbox" id="profile-check" v-model="filter.profile.check" />
379+
<span class="cache-label">check</span>
380+
</label>
381+
<div class="tooltip">?
382+
<span class="tooltiptext">
383+
Check build that does not generate any code.
384+
</span>
385+
</div>
386+
</li>
387+
<li>
388+
<label>
389+
<input type="checkbox" id="profile-debug" v-model="filter.profile.debug" />
390+
<span class="cache-label">debug</span>
391+
</label>
392+
<div class="tooltip">?
393+
<span class="tooltiptext">
394+
Debug build that produces unoptimized code.
395+
</span>
396+
</div>
397+
</li>
398+
<li>
399+
<label>
400+
<input type="checkbox" id="profile-opt"
401+
v-model="filter.profile.opt" />
402+
<span class="cache-label">opt</span>
403+
</label>
404+
<div class="tooltip">?
405+
<span class="tooltiptext">
406+
Release build that produces as optimized code as possible.
407+
</span>
408+
</div>
409+
</li>
410+
<li>
411+
<label>
412+
<input type="checkbox" id="profile-doc"
413+
v-model="filter.profile.doc" />
414+
<span class="cache-label">doc</span>
415+
</label>
416+
<div class="tooltip">?
417+
<span class="tooltiptext">
418+
Documentation build that produces HTML documentation site produced
419+
by `rustdoc`.
420+
</span>
421+
</div>
422+
</li>
423+
</ul>
424+
</div>
364425
<div class="section section-list-wrapper">
365426
<div class="section-heading">
366427
<div style="width: 160px;">
@@ -638,6 +699,12 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
638699
name: null,
639700
showOnlySignificant: true,
640701
filterVerySmall: true,
702+
profile: {
703+
check: true,
704+
debug: true,
705+
opt: true,
706+
doc: true
707+
},
641708
scenario: {
642709
full: true,
643710
incrFull: true,
@@ -672,6 +739,20 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
672739
const filter = this.filter;
673740
const benchmarkMap = this.benchmarkMap;
674741

742+
function profileFilter(profile) {
743+
if (profile === "check") {
744+
return filter.profile.check;
745+
} else if (profile === "debug") {
746+
return filter.profile.debug;
747+
} else if (profile === "opt") {
748+
return filter.profile.opt;
749+
} else if (profile === "doc") {
750+
return filter.profile.doc;
751+
} else {
752+
return true;
753+
}
754+
}
755+
675756
function scenarioFilter(scenario) {
676757
if (scenario === "full") {
677758
return filter.scenario.full;
@@ -702,7 +783,14 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
702783

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

705-
return scenarioFilter(testCase.scenario) && categoryFilter(testCase.category) && significanceFilter && nameFilter && magnitudeFilter;
786+
return (
787+
profileFilter(testCase.profile) &&
788+
scenarioFilter(testCase.scenario) &&
789+
categoryFilter(testCase.category) &&
790+
significanceFilter &&
791+
nameFilter &&
792+
magnitudeFilter
793+
);
706794
}
707795

708796
let testCases =
@@ -999,7 +1087,6 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
9991087
}
10001088
});
10011089

1002-
10031090
function toggleFilters(id, toggle) {
10041091
let styles = document.getElementById(id).style;
10051092
let indicator = document.getElementById(toggle);

0 commit comments

Comments
 (0)