This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit ac17c34
committed
Auto merge of rust-lang#141039 - lqd:expensive-sanity, r=compiler-errors
move expensive layout sanity check to debug assertions
It is [hard to fix](rust-lang#141006 (comment)) the slowness in the uninhabitedness computation for very big types but we can fix the very specific case of them being called during the layout sanity checks, as described in rust-lang#140944.
So this PR moves this uninhabitedness check to the other expensive layout sanity checks that are ran under `debug_assertions`.
It makes building the `lemmy_api_routes` crate's self-profile `layout_of` query go from
```
+--------------------------------------------------------+-----------+-----------------+----------+------------+---------------------------------+
| Item | Self time | % of total time | Time | Item count | Incremental result hashing time |
+--------------------------------------------------------+-----------+-----------------+----------+------------+---------------------------------+
| layout_of | 63.02s | 41.895 | 244.26s | 123703 | 50.30ms |
+--------------------------------------------------------+-----------+-----------------+----------+------------+---------------------------------+
```
on master (2m17s total), to
```
| layout_of | 330.21ms | 0.372 | 26.90s | 123703 | 53.19ms |
```
with this PR (1m15s total).
(Note that the [perf run results](rust-lang#141039 (comment)) below look a bit better than [an earlier run](https://perf.rust-lang.org/compare.html?start=4eca99a18eab3d4e28ed1ce3ee620d442955a470&end=c4a00993f8ee02c7565e7be652608817ea2fb97d&stat=instructions:u) I did in another PR. There may be some positive noise there, or post-merge results could differ a bit)
Since we discussed this today, r? `@compiler-errors` — and cc `@lcnr` and `@RalfJung.`1 file changed
+13
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | 11 | | |
21 | 12 | | |
22 | 13 | | |
| |||
29 | 20 | | |
30 | 21 | | |
31 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
32 | 36 | | |
33 | 37 | | |
34 | 38 | | |
| |||
0 commit comments