Skip to content

Conversation

@Zalathar
Copy link
Member

Checking the bootstrap-perf and compiler-perf implications of getting rid of the intermediate DynamicConfig layer.

r? ghost

@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) 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 Jan 25, 2026
@Zalathar
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Jan 25, 2026
[EXPERIMENT] Remove static booleans from `rustc_query_impl::DynamicConfig`
@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 25, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 25, 2026

☀️ Try build successful (CI)
Build commit: 8ad1208 (8ad1208acfb04ec51735a52a806c87a481c22ef3, parent: 75963ce795666bc1f961e5d60060809809f6bc68)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (8ad1208): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@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.3% [0.1%, 0.6%] 16
Regressions ❌
(secondary)
0.3% [0.0%, 0.6%] 50
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.0% [-0.1%, -0.0%] 3
All ❌✅ (primary) 0.3% [0.1%, 0.6%] 16

Max RSS (memory usage)

Results (primary 2.7%, secondary -1.4%)

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

mean range count
Regressions ❌
(primary)
2.7% [2.7%, 2.7%] 1
Regressions ❌
(secondary)
2.4% [1.3%, 5.4%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-5.2% [-6.6%, -4.3%] 6
All ❌✅ (primary) 2.7% [2.7%, 2.7%] 1

Cycles

Results (primary 2.6%, secondary -0.7%)

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

mean range count
Regressions ❌
(primary)
2.6% [2.6%, 2.6%] 1
Regressions ❌
(secondary)
3.0% [2.1%, 5.0%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.3% [-5.1%, -3.8%] 4
All ❌✅ (primary) 2.6% [2.6%, 2.6%] 1

Binary size

Results (primary -0.0%, secondary -0.0%)

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.0% [-0.0%, -0.0%] 4
Improvements ✅
(secondary)
-0.0% [-0.0%, -0.0%] 1
All ❌✅ (primary) -0.0% [-0.0%, -0.0%] 4

Bootstrap: 471.746s -> 470.583s (-0.25%)
Artifact size: 383.60 MiB -> 385.85 MiB (0.59%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jan 25, 2026
@Zalathar
Copy link
Member Author

Hmm, small but measurable regressions across the board.

@Zalathar
Copy link
Member Author

I think my takeaway here is that we could afford to take this hit if we had a specific reason (e.g. unblocking other work), but general cleanup is perhaps not quite compelling enough on its own.

@Zalathar Zalathar closed this Jan 26, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jan 26, 2026
@Zalathar Zalathar deleted the no-dynamic-config branch January 26, 2026 00:51
@petrochenkov
Copy link
Contributor

@Zalathar
Nightly rustc supports using structs in const generics, so technically all the flags could be merged into one FLAGS parameter, perhaps that will look better than what we have now.

@Zalathar
Copy link
Member Author

Oh nice.

I have a local branch where I tried to simulate const-generic structs using traits and macros, but being able to use an actual struct would be nicer.

jhpratt added a commit to jhpratt/rust that referenced this pull request Feb 2, 2026
…rcote

Use `#![feature(adt_const_params)]` for static query flags

As suggested by rust-lang#151633 (comment), this replaces multiple clunky const booleans with a single const struct, which is a bit nicer.

This should also make it easier to experiment with statically resolving other flags, like `eval_always`.

There are currently no other compiler crates using `feature(adt_const_params)`, so hopefully it's mature enough for a simple use-case like this one.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 2, 2026
…rcote

Use `#![feature(adt_const_params)]` for static query flags

As suggested by rust-lang#151633 (comment), this replaces multiple clunky const booleans with a single const struct, which is a bit nicer.

This should also make it easier to experiment with statically resolving other flags, like `eval_always`.

There are currently no other compiler crates using `feature(adt_const_params)`, so hopefully it's mature enough for a simple use-case like this one.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 2, 2026
…rcote

Use `#![feature(adt_const_params)]` for static query flags

As suggested by rust-lang#151633 (comment), this replaces multiple clunky const booleans with a single const struct, which is a bit nicer.

This should also make it easier to experiment with statically resolving other flags, like `eval_always`.

There are currently no other compiler crates using `feature(adt_const_params)`, so hopefully it's mature enough for a simple use-case like this one.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 2, 2026
…rcote

Use `#![feature(adt_const_params)]` for static query flags

As suggested by rust-lang#151633 (comment), this replaces multiple clunky const booleans with a single const struct, which is a bit nicer.

This should also make it easier to experiment with statically resolving other flags, like `eval_always`.

There are currently no other compiler crates using `feature(adt_const_params)`, so hopefully it's mature enough for a simple use-case like this one.
rust-timer added a commit that referenced this pull request Feb 3, 2026
Rollup merge of #151938 - Zalathar:adt-query-flags, r=nnethercote

Use `#![feature(adt_const_params)]` for static query flags

As suggested by #151633 (comment), this replaces multiple clunky const booleans with a single const struct, which is a bit nicer.

This should also make it easier to experiment with statically resolving other flags, like `eval_always`.

There are currently no other compiler crates using `feature(adt_const_params)`, so hopefully it's mature enough for a simple use-case like this one.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) perf-regression Performance regression. 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