Skip to content

Commit 79a6fa3

Browse files
committed
Show target in runtime benchmark comparison page
1 parent 23db0cf commit 79a6fa3

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

site/frontend/src/pages/compare/runtime/common.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import {BenchmarkFilter, StatComparison} from "../types";
22
import {calculateComparison, TestCaseComparison} from "../data";
33
import {benchmarkNameMatchesFilter} from "../shared";
4+
import {Target} from "../compile/common";
45

56
export interface RuntimeTestCase {
67
benchmark: string;
8+
target: Target;
79
}
810

911
export type RuntimeBenchmarkFilter = BenchmarkFilter;
@@ -16,6 +18,7 @@ export const defaultRuntimeFilter: RuntimeBenchmarkFilter = {
1618

1719
export interface RuntimeBenchmarkComparison {
1820
benchmark: string;
21+
target: Target;
1922
comparison: StatComparison;
2023
}
2124

@@ -37,6 +40,7 @@ export function computeRuntimeComparisonsWithNonRelevant(
3740
(c: RuntimeBenchmarkComparison): TestCaseComparison<RuntimeTestCase> => {
3841
let testCase = {
3942
benchmark: c.benchmark,
43+
target: c.target,
4044
};
4145
return calculateComparison(c.comparison, testCase);
4246
}

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script setup lang="ts">
22
import {TestCaseComparison} from "../data";
33
import Tooltip from "../tooltip.vue";
4-
import {percentClass} from "../shared";
4+
import {formatTarget, percentClass} from "../shared";
55
import {RuntimeTestCase} from "./common";
66
import {computed} from "vue";
77
import Accordion from "../../../components/accordion.vue";
@@ -52,6 +52,7 @@ const unit = computed(() => {
5252
<tr>
5353
<th class="toggle-arrow"></th>
5454
<th>Benchmark</th>
55+
<th>Target</th>
5556
<th>% Change</th>
5657
<th>
5758
Significance Threshold
@@ -86,6 +87,9 @@ const unit = computed(() => {
8687
<td>
8788
{{ comparison.testCase.benchmark }}
8889
</td>
90+
<td :title="comparison.testCase.target">
91+
{{ formatTarget(comparison.testCase.target) }}
92+
</td>
8993
<td>
9094
<div class="numeric-aligned">
9195
<div>

site/src/api.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ pub mod comparison {
340340
#[derive(Debug, Clone, Serialize)]
341341
pub struct RuntimeBenchmarkComparison {
342342
pub benchmark: String,
343+
pub target: String,
343344
pub comparison: StatComparison,
344345
}
345346
}

site/src/comparison.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ pub async fn handle_compare(
163163
.into_iter()
164164
.map(|comparison| api::comparison::RuntimeBenchmarkComparison {
165165
benchmark: comparison.benchmark.to_string(),
166+
target: comparison.target.to_string(),
166167
comparison: comparison.comparison.into(),
167168
})
168169
.collect();

0 commit comments

Comments
 (0)