Skip to content

Cache build dependencies for a given benchmark #678

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 2, 2020
Merged
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
19 changes: 13 additions & 6 deletions collector/src/bin/rustc-perf-collector/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -947,19 +947,26 @@ impl Benchmark {
) -> anyhow::Result<()> {
let iterations = cmp::min(iterations, self.config.runs);

if self.config.disabled {
if self.config.disabled || build_kinds.is_empty() {
eprintln!("Skipping {}: disabled", self.name);
bail!("disabled benchmark");
}

eprintln!("Preparing {} (with {:?})", self.name, build_kinds[0]);
// Build everything, including all dependent crates, in a temp dir with
// the first build kind we're building for. The intent is to cache build
// dependencies at least between runs.
let prep_dir = self.make_temp_dir(&self.path)?;
self.mk_cargo_process(compiler, prep_dir.path(), build_kinds[0])
.run_rustc()?;

for &build_kind in build_kinds {
eprintln!("Running {}: {:?} + {:?}", self.name, build_kind, run_kinds);

// Build everything, including all dependent crates, in a temp dir.
// We do this before the iterations so that dependent crates aren't
// built on every iteration. A different temp dir is used for the
// timing builds.
let prep_dir = self.make_temp_dir(&self.path)?;
// Rebuild the prepared crates for the given profile. This shouldn't
// rebuild build dependencies but will likely rebuild everything
// else -- that's fine though.
let prep_dir = self.make_temp_dir(prep_dir.path())?;
self.mk_cargo_process(compiler, prep_dir.path(), build_kind)
.run_rustc()?;

Expand Down