Skip to content

[DO NOT MERGE] benchmark leaking the Compiler struct - #165610

Draft
lolbinarycat wants to merge 1 commit into
rust-lang:mainfrom
lolbinarycat:experiment-leak-compiler
Draft

lolbinarycat wants to merge 1 commit into
rust-lang:mainfrom
lolbinarycat:experiment-leak-compiler

Conversation

@lolbinarycat

Copy link
Copy Markdown
Contributor

according to the detailed results it takes 0.000 seconds to drop the Compiler struct, but there's a lil bit of finagling with the profiler (since that's normally stored IN the compiler struct), so i'm just going to do a perf run to make sure that's accurate, since theoretically it should be faster to let the OS clean up this memory instead of manually returning it to a heap that will stop existing soon.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 7, 2026
@lolbinarycat

Copy link
Copy Markdown
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 7, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Nov 7, 2026
[DO NOT MERGE] benchmark leaking the Compiler struct
@rust-bors

rust-bors Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 6831d44 failed: CI. Failed jobs:

@lolbinarycat
lolbinarycat force-pushed the experiment-leak-compiler branch from 17e08c4 to 5ffbd6d Compare November 7, 2026 17:39
@lolbinarycat

Copy link
Copy Markdown
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Nov 7, 2026
[DO NOT MERGE] benchmark leaking the Compiler struct
@rust-bors

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-bors

rust-bors Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 01d9fb4 (01d9fb401af1248ff8dd983416ec411dd4d47a64)
Base parent: 9358362 (93583629f7429a9ab9fb807408e66eed81f3e5b1)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown

Finished benchmarking commit (01d9fb4): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

@bors rollup=never rustc-perf
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.5% [-1.0%, -0.2%] 10
Improvements ✅
(secondary)
-0.4% [-1.7%, -0.2%] 65
All ❌✅ (primary) -0.5% [-1.0%, -0.2%] 10

Max RSS (memory usage)

This perf run didn't have relevant results for this metric.

Cycles

Results (secondary -3.7%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.7% [-5.7%, -2.1%] 3
All ❌✅ (primary) - - 0

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 483.511s -> 484.119s (0.13%)
Artifact size: 406.19 MiB -> 406.28 MiB (0.02%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 7, 2026
@lolbinarycat

Copy link
Copy Markdown
Contributor Author

it seems like this makes a significant difference for very small crates, which could make a difference for large projects with many small dependancies... would it be worth it to implement this properly?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants