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.
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
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
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-01-20
- 索引更新时间
- 2026-03-03
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!