-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nightly feature tracking: get rid of the per-feature bool fields #132027
Conversation
Some changes occurred in src/tools/clippy cc @rust-lang/clippy Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri HIR ty lowering was modified cc @fmease Some changes occurred in exhaustiveness checking cc @Nadrieril Some changes occurred in cc @BoxyUwU Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred in src/librustdoc/clean/types.rs cc @camelid These commits modify compiler targets. Some changes occurred in match checking cc @Nadrieril changes to the core type system Some changes occurred in match lowering cc @Nadrieril Some changes occurred in cc @BoxyUwU |
16e611f
to
dd8850b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A nice simplification. Just a few minor comments.
Let's do another perf run, just to be sure: @bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
…=<try> nightly feature tracking: get rid of the per-feature bool fields The `struct Features` that tracks which features are enabled has a ton of public `bool`-typed fields that are basically caching the result of looking up the corresponding feature in `enabled_lang_features`. Having public fields with an invariant is not great, so at least they should be made private. However, it turns out caching these lookups is actually [not worth it](rust-lang#131321 (comment)), so this PR just entirely gets rid of these fields. (The alternative would be to make them private and have a method for each of them to expose them in a read-only way. Most of the diff of this PR would be the same in that case.) r? `@nnethercote`
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
dd8850b
to
6de4afd
Compare
5cdf91a
to
4463885
Compare
This PR is very conflict-heavy so I'd appreciate if we could delegate minor improvements to a future PR. |
Finished benchmarking commit (740f801): comparison URL. Overall result: ❌ regressions - please read the text belowBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary 2.1%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (secondary -2.6%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 780.615s -> 779.786s (-0.11%) |
☀️ Test successful - checks-actions |
Finished benchmarking commit (be01dab): comparison URL. Overall result: ❌ regressions - please read the text belowOur benchmarks found a performance regression caused by this PR. Next Steps:
@rustbot label: +perf-regression Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary 1.0%, secondary 2.3%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (secondary 2.5%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 781.646s -> 780.494s (-0.15%) |
Hm, that's a bit more than we expected, isn't it? |
Occasionally we get a weird results where lots of benchmarks get a little worse, and then things go back on the next merge. This looks like such a case. Especially given that there were two previous perf runs (one here, one in #131321) that looked better. So I think nothing needs to be done here. @rustbot label: +perf-regression-triaged |
The
struct Features
that tracks which features are enabled has a ton of publicbool
-typed fields that are basically caching the result of looking up the corresponding feature inenabled_lang_features
. Having public fields with an invariant is not great, so at least they should be made private. However, it turns out caching these lookups is actually not worth it, so this PR just entirely gets rid of these fields. (The alternative would be to make them private and have a method for each of them to expose them in a read-only way. Most of the diff of this PR would be the same in that case.)r? @nnethercote