cargo-llvm-lines
Analyzes LLVM IR to find monomorphization bloat and compile time hotspots. Use when debugging slow builds, reducing binary size, or optimizing generic code.
Installation
Suivez les instructions du dépôt pour votre agent. Consultez les fichiers et dépendances avant l’installation.
Voir la source ↗GuidesInstructions
cargo-llvm-lines
Shows which functions generate the most LLVM IR lines, indicating compile time and binary size contributors.
Usage
cargo llvm-lines [OPTIONS]
Common Workflows
Analyze library crate
cargo llvm-lines --lib
Analyze specific binary
cargo llvm-lines --bin my_bin
Sort by copy count (monomorphization)
cargo llvm-lines --lib --sort copies
Filter to specific functions
cargo llvm-lines --lib | grep "my_module"
Key Options
-
--lib- Analyze library target -
--bin <NAME>- Analyze specific binary -
--release- Use release profile -
--sort lines|copies- Sort by IR lines (default) or instantiation count
Reading Output
Output format: Lines | Copies | Function
Lines Copies Function name
----- ------ -------------
30000 100 core::fmt::write
5000 50 alloc::vec::Vec<T>::push
- Lines - Total LLVM IR lines from all instantiations
- Copies - Number of monomorphized copies
- High copies with moderate lines = monomorphization bloat
Common Fixes
- Extract non-generic inner functions to reduce copies
- Use
dyn Traitinstead of generics for cold paths - Consider
#[inline(never)]on large generic functions
Exemples
Consultez les exemples du dépôt source.
Voir la source ↗Historique source
- Date d’indexation
- 2026-01-20
- Mise à jour de l’index
- 2026-03-03
- Branch
- main
Les dates concernent ce répertoire. Consultez le dépôt pour l’historique du code.
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!