You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.`
0 commit comments