Open
Description
When profiling Clippy either with Valgrind or with cargo lintcheck --perf
, we can see that Clippy does a lot of use out of LLVM symbols. We need to investigate why is that the case and how can we remediate it.
Using Valgrind (specifically Callgrind), turns out that we are spending a lot of resources on LLVM symbols that cargo check
does not spend resources on.
Where are the LLVM calls coming from? I have some theories.
- We are using a query/function that triggers codegen.
- Clippy does not actually deactivate codegen (weird)
#![feature(rustc_private)]
for importingrustc_hir
and such automatically imports LLVM and performs some internal LLVM function.
Some time ago I talked about why does Clippy have so many relocations, and how it could be caused by the dynamic linking. Since then I've had a chat with someone that mentioned that LLVM compilation suffers from a lot of relocations, and how that could be the reason.