Skip to content

feat: add optional tracing performance spans#125

Open
syphar wants to merge 4 commits intorust-lang:mainfrom
syphar:tracing
Open

feat: add optional tracing performance spans#125
syphar wants to merge 4 commits intorust-lang:mainfrom
syphar:tracing

Conversation

@syphar
Copy link
Copy Markdown
Member

@syphar syphar commented May 4, 2026

I want to dig deeper on optimizing build speed, and first step is measuring where exactly we spend time.

Comment thread src/cmd/mod.rs Outdated
ManagedByRustwide(PathBuf),
}

impl fmt::Debug for Binary {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a code comment explaining why you didn't derive it instead (I suppose it's because you want to skip the enum's name but please still write it down).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking too much yesterday, changed to be the derive

Comment thread src/cmd/mod.rs
source_dir_mount_kind: MountKind,
}

impl fmt::Debug for Command<'_, '_> {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why isn't it a derive?

Copy link
Copy Markdown
Member Author

@syphar syphar May 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the impl itself I only added so it's easier to add the important Command info to the tracing spans. Not using the derive because I didn't want some things that might be noisy (env), and others don't have their own Debug impl (SandboxBuilder, and process_lines).

I updated the impl to it's more near to what I would expect from a "normal" debug impl.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then add a code comment to explain that. ;)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a comment (and, admitted, udpated the impl again 😅 )

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