about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-03-23 09:23:07 +0000
committerbors <bors@rust-lang.org>2023-03-23 09:23:07 +0000
commitbe01b983c48b75f4a7602f1e4568cd75c0b280ee (patch)
treeb50da7f94688a988e2f159b84a71a634d1892526 /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
parent1d1e72308e5bcdf5abe95c1d29dfe82524940061 (diff)
parent966d5b0e348c9bd29eb1d9ddc2c2cf42555a25b7 (diff)
downloadrust-be01b983c48b75f4a7602f1e4568cd75c0b280ee.tar.gz
rust-be01b983c48b75f4a7602f1e4568cd75c0b280ee.zip
Auto merge of #10533 - Nilstrieb:cache, r=dswij
Significantly optimize `significant_drop_tightening`

The lint is very slow as it doesn't cache the deeply nested check for the attribute. If we cache it, we can reduce the time spent on checking `rustc_borrowck` from 28s to 9s, which is a nice improvement. In the profile, the time inside `has_sig_drop_attr` goes from 66% to 0.2%, which is a lot more reasonable.

<details>
<summary>Flame graphs</summary>

Before (all the tall `clippy` towers are `has_sig_drop_attr`):
![before](https://user-images.githubusercontent.com/48135649/227037243-bcd93bbe-a4ad-45c3-be25-2b021b12a5c0.svg)

After:
![after](https://user-images.githubusercontent.com/48135649/227040322-8d3f0448-18e3-4923-8187-c72df324a3fa.svg)
</details>

Fixes #10532

changelog: [`significant_drop_tightening`]: significantly optimized
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions