Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -30,13 +31,12 @@ function normalizeBackend(backend: string): string {
Command for analyzing binary size locally
<Tooltip>
Execute this command in a checkout of
<a href="https://github.com/rust-lang/rustc-perf">rustc-perf</a>, after a
`cargo build --release`, to compare binary section sizes. Add `--symbols`
to include a diff of symbol sizes.
<a href="https://github.com/rust-lang/rustc-perf">rustc-perf</a>. Add
`--symbols` to include a diff of symbol sizes.
</Tooltip>
</div>

<pre><code>cargo run --release --bin collector \
<pre><code>{{ cargo_collector_command() }} \
binary_stats compile \
+{{ props.baseArtifact.commit }} \
--rustc2 +{{ props.artifact.commit }} \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -36,7 +37,7 @@ function normalizeScenario(scenario: string): string {
</script>

<template>
<pre><code>cargo run --release --bin collector \
<pre><code>{{ cargo_collector_command() }} \
profile_local cachegrind \
+{{ firstCommit }} \<template v-if="props.baselineCommit !== undefined">
--rustc2 +{{ props.commit }} \</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ const profileBaselineCommit = computed(() => {
Command for profiling locally
<Tooltip>
Execute this command in a checkout of
<a href="https://github.com/rust-lang/rustc-perf">rustc-perf</a>, after a
`cargo build --release`, to generate a Cachegrind profile.
<a href="https://github.com/rust-lang/rustc-perf">rustc-perf</a> to
generate a Cachegrind profile.
</Tooltip>
</div>

Expand Down
7 changes: 4 additions & 3 deletions site/frontend/src/pages/detailed-query/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
chromeProfileUrl,
processedSelfProfileRelativeUrl,
} from "../../self-profile";
import {cargo_collector_command} from "../../utils/cargo";

export interface Selector {
commit: string;
Expand Down Expand Up @@ -198,23 +199,23 @@ 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
${profile(state.benchmark)} --scenarios ${scenarioFilter(
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
${profile(state.benchmark)} --scenarios ${scenarioFilter(
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
Expand Down
9 changes: 9 additions & 0 deletions site/frontend/src/utils/cargo.ts
Original file line number Diff line number Diff line change
@@ -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";
}
Loading