Skip to content

Micro-optimize two package dir functions - #17413

Merged
ranger-ross merged 1 commit into
rust-lang:masterfrom
Kobzol:build-dir-microopt
Aug 31, 2026
Merged

Micro-optimize two package dir functions#17413
ranger-ross merged 1 commit into
rust-lang:masterfrom
Kobzol:build-dir-microopt

Conversation

@Kobzol

@Kobzol Kobzol commented Aug 31, 2026

Copy link
Copy Markdown
Member

Looked into this while profiling #17410 (context).

Those two changes reduce the total duration of collecting dep dirs from ~56ms to ~40ms on Zed. Not a huge win, but for such a small change.. The format! change is a bit annoying (there the win was ~5ms), but the build_dir change is IMO straightforward and just worth it to reduce an unnecessary PathBuf copy (there the win was ~10ms).

r? @ranger-ross

@rustbot rustbot added the A-layout Area: target output directory layout, naming, and organization label Aug 31, 2026
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 31, 2026

@ranger-ross ranger-ross left a comment

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.

Thanks!

Good find, I didn't think to look inside the compilation_files functions

View changes since this review

@ranger-ross
ranger-ross added this pull request to the merge queue Aug 31, 2026
Merged via the queue into rust-lang:master with commit 83dd0b2 Aug 31, 2026
28 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 31, 2026
@Kobzol
Kobzol deleted the build-dir-microopt branch August 31, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-layout Area: target output directory layout, naming, and organization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants