Skip to content

Commit 885e01f

Browse files
committed
Propagate target data of compile benchmarks to the frontend
1 parent a5eb3ac commit 885e01f

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ export const defaultCompileFilter: CompileBenchmarkFilter = {
7272
export type Profile = "check" | "debug" | "opt" | "doc";
7373
export type CodegenBackend = "llvm" | "cranelift";
7474
export type Category = "primary" | "secondary";
75+
export type Target = "x86_64-unknown-linux-gnu";
7576

7677
export type CompileBenchmarkMap = Dict<CompileBenchmarkMetadata>;
7778

@@ -95,6 +96,7 @@ export interface CompileBenchmarkComparison {
9596
profile: Profile;
9697
scenario: string;
9798
backend: CodegenBackend;
99+
target: Target;
98100
comparison: StatComparison;
99101
}
100102

@@ -103,6 +105,7 @@ export interface CompileTestCase {
103105
profile: Profile;
104106
scenario: string;
105107
backend: CodegenBackend;
108+
target: Target;
106109
category: Category;
107110
}
108111

@@ -198,6 +201,7 @@ export function computeCompileComparisonsWithNonRelevant(
198201
profile: c.profile,
199202
scenario: c.scenario,
200203
backend: c.backend,
204+
target: c.target,
201205
category: (benchmarkMap[c.benchmark] || {}).category || "secondary",
202206
};
203207
return calculateComparison(c.comparison, testCase);
@@ -242,18 +246,20 @@ export function transformDataForBackendComparison(
242246
cranelift: number | null;
243247
benchmark: string;
244248
profile: Profile;
249+
target: Target;
245250
scenario: string;
246251
}
247252
> = new Map();
248253
for (const comparison of comparisons) {
249-
const key = `${comparison.benchmark};${comparison.profile};${comparison.scenario}`;
254+
const key = `${comparison.benchmark};${comparison.profile};${comparison.scenario};${comparison.target}`;
250255
if (!benchmarkMap.has(key)) {
251256
benchmarkMap.set(key, {
252257
llvm: null,
253258
cranelift: null,
254259
benchmark: comparison.benchmark,
255260
profile: comparison.profile,
256261
scenario: comparison.scenario,
262+
target: comparison.target,
257263
});
258264
}
259265
const record = benchmarkMap.get(key);
@@ -271,6 +277,7 @@ export function transformDataForBackendComparison(
271277
scenario: entry.scenario,
272278
// Treat LLVM as the baseline
273279
backend: "llvm",
280+
target: entry.target,
274281
comparison: {
275282
statistics: [entry.llvm, entry.cranelift],
276283
is_relevant: true,

site/src/api.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ pub mod comparison {
332332
pub profile: String,
333333
pub scenario: String,
334334
pub backend: String,
335+
pub target: String,
335336
pub comparison: StatComparison,
336337
}
337338

site/src/comparison.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use collector::Bound;
1111
use database::{
1212
metric::Metric,
1313
selector::{self, BenchmarkQuery, CompileBenchmarkQuery, RuntimeBenchmarkQuery, TestCase},
14+
Target,
1415
};
1516
use database::{ArtifactId, Benchmark, Lookup, Profile, Scenario};
1617
use serde::Serialize;
@@ -152,6 +153,7 @@ pub async fn handle_compare(
152153
profile: comparison.profile.to_string(),
153154
scenario: comparison.scenario.to_string(),
154155
backend: comparison.backend.to_string(),
156+
target: comparison.target.to_string(),
155157
comparison: comparison.comparison.into(),
156158
})
157159
.collect();
@@ -742,6 +744,7 @@ async fn compare_given_commits(
742744
scenario: test_case.scenario,
743745
benchmark: test_case.benchmark,
744746
backend: test_case.backend,
747+
target: test_case.target,
745748
comparison,
746749
},
747750
)
@@ -1315,6 +1318,7 @@ pub struct CompileTestResultComparison {
13151318
profile: Profile,
13161319
scenario: Scenario,
13171320
backend: CodegenBackend,
1321+
target: Target,
13181322
comparison: TestResultComparison,
13191323
}
13201324

0 commit comments

Comments
 (0)