Skip to content

--timings interacts poorly with cargo clean #10410

Open
@g2p

Description

@g2p

Problem

The stabilization PR (#10245) for --timings / -Ztimings moved html reports under target/cargo-timings, which is wiped on cargo clean.

Getting reports for a clean build generally requires cargo clean, but this choice of directory makes it hard to keep reports over time, which one would need to measure progress.

Steps

Attempting to track build performance over time

  1. cargo clean; cargo build --timings
  2. Change something, try to impact build performance
  3. cargo clean; cargo build --timings
  4. Previous reports were wiped and can't be compared

Possible Solution(s)

Consider:
Using a directory outside target. reports/cargo-timings/ would work.

Making cargo clean delete only known subsets of the target directory.

A new flag, cargo clean --debug, similar to cargo clean --release, might provide a way to benchmark clean debug builds with less risk (as long as the flags are used every time).

Version

cargo +nightly version
cargo 1.61.0-nightly (ea2a21c 2022-02-15)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-timingsArea: timingsC-bugCategory: bugCommand-cleanS-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions