Try to make FieldDef smaller#157986
Conversation
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Try to make FieldDef smaller
|
The job Click to see the possible cause of the failure (guessed by this bot)For more information how to resolve CI failures of this job, visit this link. |
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (289b567): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking 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 Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 6.4%, secondary 2.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 1.4%, secondary 4.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary -0.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 522.035s -> 522.066s (0.01%) |
This comment was marked as resolved.
This comment was marked as resolved.
| pub vis: Visibility, | ||
| pub mut_restriction: MutRestriction, | ||
| pub safety: Safety, | ||
| pub extras: Option<Box<(Safety, MutRestriction, Option<AnonConst>)>>, |
There was a problem hiding this comment.
I tried to put this into a separate struct instead of a tuple, but got a lot of compile errors in derive impls. I'm not sure what's the problem.
There was a problem hiding this comment.
The new structure will need to be registered somewhere in compiler\rustc_ast\src\visit.rs.
| None => &DEFAULT, | ||
| } | ||
| } | ||
| pub fn default(&self) -> Option<&AnonConst> { |
There was a problem hiding this comment.
We should maybe use different name, to avoid confusion with Default::default()
There was a problem hiding this comment.
default_val/default_value could work.
|
I'll undraft this for preliminary review, because I want to get some second opinion. This helps to mitigate the perf regression, but feels somewhat arbitrary/ad-hoc to me? I'm not sure if this is the right approach. Also, this exploits the fact that these features are unstable, and used rarely - as soon as the majority of fields in the ecosystem use at least one of those features (presumably the default value in most cases), this will no longer be an optimization. |
|
The parser was modified, potentially altering the grammar of (stable) Rust cc @fmease
cc @rust-lang/clippy
cc @rust-lang/rustfmt |
|
r? @khyperia rustbot has assigned @khyperia. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
apologies, I've fallen ill and probably won't get around to reviewing this for a while, so I'm rerolling r? compiler |
|
Reminder, once the PR becomes ready for a review, use |
Tries to mitigate the regression from #156824. We do this by Option Boxing together all the properties that are only used for unstable features.
fixes #157003