summary refs log tree commit diff
path: root/src/test/ui/stats
AgeCommit message (Collapse)AuthorLines
2022-12-01rustc_ast_lowering: Stop lowering imports into multiple itemsVadim Petrochenkov-22/+22
Lower them into a single item with multiple resolutions instead. This also allows to remove additional `NodId`s and `DefId`s related to those additional items.
2022-11-23Separate lifetime ident from resolution in HIR.Camille GILLOT-4/+4
2022-11-22fix tests, update size assertsThe 8472-10/+11
2022-11-18Auto merge of #101562 - nnethercote:shrink-ast-Expr-harder, r=petrochenkovbors-102/+102
Shrink `ast::Expr` harder r? `@ghost`
2022-11-17Use `ThinVec` in `ast::Path`.Nicholas Nethercote-98/+98
2022-11-17Box `ExprKind::{Closure,MethodCall}`, and `QSelf` in expressions, types, and ↵Nicholas Nethercote-89/+89
patterns.
2022-11-13Store a LocalDefId in hir::Variant & hir::Field.Camille GILLOT-5/+5
2022-11-13Store a LocalDefId in hir::AnonConst.Camille GILLOT-16/+16
2022-10-10Rename AssocItemKind::TyAlias to AssocItemKind::TypeMichael Goulet-2/+2
2022-09-30Rollup merge of #102495 - nnethercote:reinstate-hir-stats, r=lqdMatthias Krüger-1/+0
Reinstate `hir-stats.rs` test for stage 1. It was disabled in #94075 for stage 1 because that PR changed type layouts such that the results for this test were different for stage 1 and stage 2. But now that #94075 is in beta, the results for this test are now the same for stage 1 and stage 2. r? ```@lqd```
2022-09-30Reinstate `hir-stats.rs` test for stage 1.Nicholas Nethercote-1/+0
It was disabled in #94075 for stage 1 because that PR changed type layouts such that the results for this test were different for stage 1 and stage 2. But now that #94075 is in beta, the results for this test are now the same for stage 1 and stage 2.
2022-09-29Shrink `hir::def::Res`.Nicholas Nethercote-46/+46
`Res::SelfTy` currently has two `Option`s. When the second one is `Some` the first one is never consulted. So we can split it into two variants, `Res::SelfTyParam` and `Res::SelfTyAlias`, reducing the size of `Res` from 24 bytes to 12. This then shrinks `hir::Path` and `hir::PathSegment`, which are the HIR types that take up the most space.
2022-09-27Bless stats.Camille GILLOT-6/+6
2022-09-08Introduce `DotDotPos`.Nicholas Nethercote-12/+12
This shrinks `hir::Pat` from 88 to 72 bytes.
2022-09-08Arena-allocate `hir::Lifetime`.Nicholas Nethercote-34/+35
This shrinks `hir::Ty` from 72 to 48 bytes. `visit_lifetime` is added to the HIR stats collector because these types are now stored in memory on their own, instead of being within other types.
2022-09-07Use niche-filling optimization even when multiple variants have data.Michael Benfield-22/+23
Fixes #46213
2022-09-05use `propagate_through_exprs` instead of `propagate_through_expr`Takayuki Maeda-22/+22
fix `ExprKind` static_assert_size fix hir-stats
2022-08-29Improve HIR stats collector.Nicholas Nethercote-20/+52
Adds and removes some `visit_*` methods accordingly, improving coverage, and avoiding some double counting. Brings it in line with the AST stats collector.
2022-08-29Add prefix to every line of `-Zhir-stats` output.Nicholas Nethercote-151/+145
This is based on `-Zprint-type-sizes` which does the same thing. It makes the output provenance clearer, and helps with post-processing. E.g. if you have `-Zhir-stats` output from numerous compiler invocations you can now easily extract the pre-expansion stats separately from the post-expansion stats.
2022-08-22Use `AttrVec` in more places.Nicholas Nethercote-67/+67
In some places we use `Vec<Attribute>` and some places we use `ThinVec<Attribute>` (a.k.a. `AttrVec`). This results in various points where we have to convert between `Vec` and `ThinVec`. This commit changes the places that use `Vec<Attribute>` to use `AttrVec`. A lot of this is mechanical and boring, but there are some interesting parts: - It adds a few new methods to `ThinVec`. - It implements `MapInPlace` for `ThinVec`, and introduces a macro to avoid the repetition of this trait for `Vec`, `SmallVec`, and `ThinVec`. Overall, it makes the code a little nicer, and has little effect on performance. But it is a precursor to removing `rustc_data_structures::thin_vec::ThinVec` and replacing it with `thin_vec::ThinVec`, which is implemented more efficiently.
2022-08-17Box the `MacCall` in various types.Nicholas Nethercote-55/+55
2022-08-16Shrink `ast::Attribute`.Nicholas Nethercote-100/+100
2022-08-11Add a second level to the AST size reporting.Nicholas Nethercote-2/+62
This tells you which variants of the enums are most common, which is very useful. I've only done it for the AST for now, HIR can be done later.
2022-08-11Add percentages to `-Zhir-stats` output.Nicholas Nethercote-70/+70
2022-08-11Change how `AssocItem` is reported.Nicholas Nethercote-4/+2
Currently it's reported as either `TraitItem` or `ImplItem`. This commit changes it to `AssocItem`, because having the report match the type name is (a) consistent with other types, and (b) the trait/impl split isn't that important here.
2022-08-11Improve AST stat collector.Nicholas Nethercote-5/+15
This commit: - Adds a comment explaining which `visit_*` methods should be implemented. - Adds and removes some `visit_*` methods accordingly, improving coverage, and avoiding some double counting.
2022-08-11Add a test for `-Zhir-stats` output.Nicholas Nethercote-0/+124
This will be very useful in subsequent commits where I will improve the output.