Skip to content

[replay #17411] Cargo profiling improvements - #11

Closed
ved-merget wants to merge 1 commit into
mainfrom
replay/pr-17411
Closed

ved-merget wants to merge 1 commit into
mainfrom
replay/pr-17411

Conversation

@ved-merget

Copy link
Copy Markdown

Replay of rust-lang/cargo#17411 (4 files): its net change applied onto the common base 0b47ab4fc947679d5af9b7e5382e05e1484e1984 so this branch is a sibling of the other replays. Generated by merget-harness mh bench; this mirror is disposable.

### What does this PR try to resolve?

This PR makes a couple of small improvements to our profiling by:
1. Removing/modifying `trace!()` calls that log large objects
(`UnitGraph`) or all called from a hot loop (in the case of
`build_sbom_graph`)
2. Added more detailed instrumentation to the `fn compile()` while
trying to avoid instrumenting leaf functions.

Below are some tracing examples from using profiling on the Zed
repository.

**Before**

<img width="2068" height="502" alt="image"
src="https://github.com/user-attachments/assets/48f85737-e6cd-4fcf-b792-e8126d94c8a4"
/>

**After**

<img width="2067" height="501" alt="image"
src="https://github.com/user-attachments/assets/b82be28b-1268-40c6-9a66-4397c76b2cdc"
/>

### How to test and review this PR?

`CARGO_LOG_PROFILE=true CARGO_LOG_PROFILE_CAPTURE_ARGS=true cargo build`
on your favorite repo :)
@ved-merget ved-merget closed this Sep 15, 2026
@ved-merget
ved-merget deleted the replay/pr-17411 branch September 15, 2026 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants