cargo-semver-checks
cargo-semver-checks copied to clipboard
Optimization idea: first generate current rustdoc, then baseline.
Describe your use case
Semver checking (e.g. on GitHub actions) usually gets run after another build step (cargo clippy, or cargo test). If we generate the baseline next, the cached build artifacts in the target dir are outdated and are overwritten. Then they are probably overwritten again for the current build. Emphasis on "probably" -- this is what we'd be looking to verify with a test.
If that's right, then generating the current rustdoc JSON first should reuse those build artifacts before the baseline build overwrites them. (At which point another cargo build would be necessary to realize the advantage again.)
Describe the solution you'd like
Implement the proposed changes (this part is on accident already done in https://github.com/obi1kenobi/cargo-semver-checks/pull/270) and check whether it works. Compare the rustdoc generation speed between the two orders -- there might be a noticeable improvement (in this case, it would be a cool write-up).
Alternatives, if applicable
No response
Additional Context
No response