diff --git a/site/frontend/src/pages/compare/compile/table/shortcuts/binary-size-shortcut.vue b/site/frontend/src/pages/compare/compile/table/shortcuts/binary-size-shortcut.vue
index cbdef810f..dfc29540a 100644
--- a/site/frontend/src/pages/compare/compile/table/shortcuts/binary-size-shortcut.vue
+++ b/site/frontend/src/pages/compare/compile/table/shortcuts/binary-size-shortcut.vue
@@ -8,6 +8,7 @@ import {CompileTestCase} from "../../common";
import {ArtifactDescription} from "../../../types";
import Tooltip from "../../../tooltip.vue";
import {normalizeProfile} from "./utils";
+import {cargo_collector_command} from "../../../../../utils/cargo";
const props = defineProps<{
artifact: ArtifactDescription;
@@ -30,13 +31,12 @@ function normalizeBackend(backend: string): string {
Command for analyzing binary size locally
cargo run --release --bin collector \
+ {{ cargo_collector_command() }} \
binary_stats compile \
+{{ props.baseArtifact.commit }} \
--rustc2 +{{ props.artifact.commit }} \
diff --git a/site/frontend/src/pages/compare/compile/table/shortcuts/cachegrind-cmd.vue b/site/frontend/src/pages/compare/compile/table/shortcuts/cachegrind-cmd.vue
index eaa782ac7..51d188690 100644
--- a/site/frontend/src/pages/compare/compile/table/shortcuts/cachegrind-cmd.vue
+++ b/site/frontend/src/pages/compare/compile/table/shortcuts/cachegrind-cmd.vue
@@ -6,6 +6,7 @@
import {CompileTestCase} from "../../common";
import {computed} from "vue";
import {normalizeProfile} from "./utils";
+import {cargo_collector_command} from "../../../../../utils/cargo";
const props = defineProps<{
commit: string;
@@ -36,7 +37,7 @@ function normalizeScenario(scenario: string): string {
- cargo run --release --bin collector \
+ {{ cargo_collector_command() }} \
profile_local cachegrind \
+{{ firstCommit }} \
--rustc2 +{{ props.commit }} \
diff --git a/site/frontend/src/pages/compare/compile/table/shortcuts/profile-shortcut.vue b/site/frontend/src/pages/compare/compile/table/shortcuts/profile-shortcut.vue
index 50c1da255..96e760146 100644
--- a/site/frontend/src/pages/compare/compile/table/shortcuts/profile-shortcut.vue
+++ b/site/frontend/src/pages/compare/compile/table/shortcuts/profile-shortcut.vue
@@ -49,8 +49,8 @@ const profileBaselineCommit = computed(() => {
Command for profiling locally
Execute this command in a checkout of
- rustc-perf, after a
- `cargo build --release`, to generate a Cachegrind profile.
+ rustc-perf to
+ generate a Cachegrind profile.
diff --git a/site/frontend/src/pages/detailed-query/utils.ts b/site/frontend/src/pages/detailed-query/utils.ts
index 12f024716..b34475012 100644
--- a/site/frontend/src/pages/detailed-query/utils.ts
+++ b/site/frontend/src/pages/detailed-query/utils.ts
@@ -2,6 +2,7 @@ import {
chromeProfileUrl,
processedSelfProfileRelativeUrl,
} from "../../self-profile";
+import {cargo_collector_command} from "../../utils/cargo";
export interface Selector {
commit: string;
@@ -198,7 +199,7 @@ export function createDownloadLinksData(selector: Selector | null): {
const localCommands = {
base: state.base_commit
- ? `cargo run --release --bin collector profile_local cachegrind
+ ? `${cargo_collector_command()} profile_local cachegrind
+${state.base_commit} --exact-match ${benchName(
state.benchmark
)} --profiles
@@ -206,7 +207,7 @@ export function createDownloadLinksData(selector: Selector | null): {
state.scenario
)}`
: "",
- new: `cargo run --release --bin collector profile_local cachegrind
+ new: `${cargo_collector_command()} profile_local cachegrind
+${state.commit} --exact-match ${benchName(
state.benchmark
)} --profiles
@@ -214,7 +215,7 @@ export function createDownloadLinksData(selector: Selector | null): {
state.scenario
)}`,
diff: state.base_commit
- ? `cargo run --release --bin collector profile_local cachegrind
+ ? `${cargo_collector_command()} profile_local cachegrind
+${state.base_commit} --rustc2 +${
state.commit
} --exact-match ${benchName(state.benchmark)} --profiles
diff --git a/site/frontend/src/utils/cargo.ts b/site/frontend/src/utils/cargo.ts
new file mode 100644
index 000000000..b2c109e25
--- /dev/null
+++ b/site/frontend/src/utils/cargo.ts
@@ -0,0 +1,9 @@
+/**
+ * Return a Cargo command that builds rustc-perf properly and then executes
+ * the collector.
+ * The returned command is meant to be followed by a `collector` command and its
+ * arguments.
+ */
+export function cargo_collector_command(): string {
+ return "cargo build --release -p collector && ./target/release/collector";
+}