rust-lang / rust-lang/rust-clippy
[Perf] Where are the LLVM symbols coming from?
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
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_hirand 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by profiling Clippy with Valgrind/Callgrind and cargo lintcheck --perf, then compare the LLVM activity with cargo check. Trace whether the calls come from a query that triggers codegen, codegen not being disabled, or importing rustc_private components such as rustc_hir. Done means identifying the source of the LLVM symbols and documenting or implementing a remediation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers, devtools, performance
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100