Skip to content

Commit f46eb10

Browse files
committed
Render shortened target in compile compare page
1 parent 885e01f commit f46eb10

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

site/frontend/src/pages/compare/compile/table/comparisons-table.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import {TestCaseComparison} from "../../data";
33
import Tooltip from "../../tooltip.vue";
44
import {ArtifactDescription} from "../../types";
5-
import {percentClass} from "../../shared";
5+
import {formatTarget, percentClass} from "../../shared";
66
import {CompileBenchmarkMap, CompileTestCase} from "../common";
77
import {computed} from "vue";
88
import {testCaseKey} from "../common";
@@ -62,6 +62,7 @@ const unit = computed(() => {
6262
<th>Profile</th>
6363
<th>Scenario</th>
6464
<th v-if="showBackend">Backend</th>
65+
<th>Target</th>
6566
<th>% Change</th>
6667
<th class="narrow">
6768
Significance Threshold
@@ -101,6 +102,9 @@ const unit = computed(() => {
101102
</td>
102103
<td>{{ comparison.testCase.scenario }}</td>
103104
<td v-if="showBackend">{{ comparison.testCase.backend }}</td>
105+
<td :title="comparison.testCase.target">
106+
{{ formatTarget(comparison.testCase.target) }}
107+
</td>
104108
<td>
105109
<div class="numeric-aligned">
106110
<span v-bind:class="percentClass(comparison.percent)">

site/frontend/src/pages/compare/shared.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import {Target} from "./compile/common";
2+
13
export function formatDate(dateString: string): string {
24
const date = new Date(dateString);
35
function padStr(i) {
@@ -93,3 +95,11 @@ export function benchmarkNameMatchesFilter(
9395
return benchmarkName.includes(trimmedFilterName);
9496
}
9597
}
98+
99+
const TARGET_SHORTCUTS: {[target in Target]: string} = {
100+
"x86_64-unknown-linux-gnu": "x64",
101+
};
102+
103+
export function formatTarget(target: Target): string {
104+
return TARGET_SHORTCUTS[target] ?? target;
105+
}

0 commit comments

Comments
 (0)