Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
Zentrik committed Jun 23, 2024
1 parent fc64e0c commit a8f2a12
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,4 @@ table {
text-align: right;
}
}
</style>
</style>
4 changes: 2 additions & 2 deletions site/frontend/src/pages/compare/compile/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ export function shouldShowTestCase(
const name = comparison.test_case.benchmark;
const nameFilter = filter.name && filter.name.trim();
if (!nameFilter) {
return true
} else if (filter.regex) {
return true;
} else if (filter.regex) {
try {
return name.match(nameFilter);
} catch {
Expand Down
6 changes: 1 addition & 5 deletions site/frontend/src/pages/compare/compile/compile-page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@ function loadFilterFromUrl(
): CompileBenchmarkFilter {
return {
name: urlParams["name"] ?? defaultFilter.name,
regex: getBoolOrDefault(
urlParams,
"regex",
defaultFilter.regex
),
regex: getBoolOrDefault(urlParams, "regex", defaultFilter.regex),
nonRelevant: getBoolOrDefault(
urlParams,
"nonRelevant",
Expand Down
8 changes: 3 additions & 5 deletions site/frontend/src/pages/compare/compile/filters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,11 @@ const opened = createPersistedRef(PREF_FILTERS_OPENED);
<input id="filter" type="text" v-model="filter.name" />
<button
class="regex-toggle"
:class="{ active: filter.regex }"
@click="filter.regex=!filter.regex"
:class="{active: filter.regex}"
@click="filter.regex = !filter.regex"
>
.*
<span class="regex-tooltiptext">
Use Regular Expression
</span>
<span class="regex-tooltiptext"> Use Regular Expression </span>
</button>
</div>
<div class="section">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ async function renderGraph(
) {
const opts: GraphRenderOpts = {
width: Math.min(window.innerWidth - 40, 465),
renderTitle: false
renderTitle: false,
};
if (date !== null) {
drawCurrentDate(opts, date);
Expand Down Expand Up @@ -235,8 +235,7 @@ onMounted(() => {
Each plotted value is relative to the first commit of the commit range
</div>
<div style="font-size: 0.8em">
The shaded region shows values more recent than the
benchmarked commit
The shaded region shows values more recent than the benchmarked commit
</div>
</div>
<div ref="relativeToFirstChartElement"></div>
Expand All @@ -248,8 +247,7 @@ onMounted(() => {
Each plotted value is relative to its previous commit
</div>
<div style="font-size: 0.8em">
The shaded region shows values more recent than the
benchmarked commit
The shaded region shows values more recent than the benchmarked commit
</div>
</div>
<div ref="relativeToPreviousChartElement"></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ const props = defineProps<{
}>();
function benchmarkLink(benchmark: string): string {
return `https://github.com/JuliaCI/BaseBenchmarks.jl/tree/master/src/${benchmark.split('.')[0]}`;
return `https://github.com/JuliaCI/BaseBenchmarks.jl/tree/master/src/${
benchmark.split(".")[0]
}`;
}
function graphLink(
Expand Down Expand Up @@ -80,9 +82,7 @@ function graphLink(
:base-artifact="baseArtifact"
/>
<div class="shortcut">
<ProfileShortcut
:test-case="props.testCase"
/>
<ProfileShortcut :test-case="props.testCase" />
</div>
</div>
</template>
Expand Down
37 changes: 21 additions & 16 deletions site/frontend/src/pages/compare/compile/table/comparisons-table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Tooltip from "../../tooltip.vue";
import {ArtifactDescription} from "../../types";
import {percentClass} from "../../shared";
import {CompileTestCase} from "../common";
import {computed, onMounted, onBeforeUnmount, ref, watchEffect} from 'vue';
import {computed, onMounted, onBeforeUnmount, ref, watchEffect} from "vue";
import {testCaseKey} from "../common";
import BenchmarkDetail from "./benchmark-detail.vue";
import Accordion from "../../../../components/accordion.vue";
Expand All @@ -29,16 +29,18 @@ function prettifyRawNumber(number: number): string {
const showSignificanceData = ref(true);
const updateShowSignificanceData = () => {
let width_of_cols = 97.8 * (3 + (props.showRawData ? 2 : 0)) + 14 + 50; // Excluding benchmark name column
let width_with_sig_data = width_of_cols + 97.8*2 + 50;
showSignificanceData.value = !window.matchMedia(`(max-width: ${width_with_sig_data}px)`).matches;
let width_with_sig_data = width_of_cols + 97.8 * 2 + 50;
showSignificanceData.value = !window.matchMedia(
`(max-width: ${width_with_sig_data}px)`
).matches;
};
onMounted(() => {
updateShowSignificanceData();
window.addEventListener('resize', updateShowSignificanceData);
window.addEventListener("resize", updateShowSignificanceData);
});
onBeforeUnmount(() => {
window.removeEventListener('resize', updateShowSignificanceData);
window.removeEventListener("resize", updateShowSignificanceData);
});
// Modify this when changing the number of columns in the table!
const columnCount = ref(5); // initial value
Expand Down Expand Up @@ -88,8 +90,10 @@ const unit = computed(() => {
the significance threshold, the noisier a test case is. You can
see
<a
href="https://github.com/rust-lang/rustc-perf/blob/master/docs/comparison-analysis.md#what-makes-a-test-result-significant">
here</a>
href="https://github.com/rust-lang/rustc-perf/blob/master/docs/comparison-analysis.md#what-makes-a-test-result-significant"
>
here</a
>
how the significance threshold is calculated.
</Tooltip>
</th>
Expand Down Expand Up @@ -127,8 +131,8 @@ const unit = computed(() => {
{{
comparison.comparison.significance_threshold
? (
100 * comparison.comparison.significance_threshold
).toFixed(2) + "%"
100 * comparison.comparison.significance_threshold
).toFixed(2) + "%"
: "-"
}}
</div>
Expand All @@ -139,7 +143,8 @@ const unit = computed(() => {
<div>
{{
comparison.comparison.significance_factor
? comparison.comparison.significance_factor.toFixed(2) + "x"
? comparison.comparison.significance_factor.toFixed(2) +
"x"
: "-"
}}
</div>
Expand Down Expand Up @@ -201,7 +206,6 @@ const unit = computed(() => {
}
.benches {
td,
th {
text-align: center;
Expand All @@ -211,27 +215,28 @@ const unit = computed(() => {
width: 5px;
}
&.narrow, &.pct-change {
&.narrow,
&.pct-change {
word-wrap: break-word;
width: 90px;
}
&.raw-data {
width:90px;
width: 90px;
text-align: right;
}
}
}
.benches td {
&>.numeric-aligned {
& > .numeric-aligned {
display: flex;
flex-direction: column;
align-items: center;
text-align: right;
&>div,
&>span {
& > div,
& > span {
width: 60px;
}
}
Expand Down
3 changes: 1 addition & 2 deletions site/frontend/src/pages/compare/summary/overall-summary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const summary = computed(() => props.summary);
.tooltip-container {
position: absolute;
right: -7px;
top: 5px
top: 5px;
}
:deep(.tooltiptext) {
Expand All @@ -52,5 +52,4 @@ const summary = computed(() => props.summary);
margin-left: -22px !important;
}
}
</style>
2 changes: 1 addition & 1 deletion site/frontend/src/pages/compare/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ export interface CompareResponse {
export enum Tab {
CompileTime = "compile",
ArtifactSize = "artifact-size",
}
}

0 comments on commit a8f2a12

Please sign in to comment.