cargo-llvm-lines | Skill Performance & Reviews | TopRankSkills

TopRank Skills

Home / Skills / tools / cargo-llvm-lines

cargo-llvm-lines

maintained by onbjerg

star 4 account_tree 1 verified_user MIT License
bolt View GitHub

name: cargo-llvm-lines description: Analyzes LLVM IR to find monomorphization bloat and compile time hotspots. Use when debugging slow builds, reducing binary size, or optimizing generic code.

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 Trait instead of generics for cold paths
  • Consider #[inline(never)] on large generic functions

chat Comments (0)

chat_bubble_outline

No comments yet. Be the first to share your thoughts!

Skill Details

GitHub Stars 4
GitHub Forks 1
Created Jan 2026
Last Updated 4个月前
tools tools debugging

Related Skills

fabric
chevron_right
typescript-expert
chevron_right
break-loop
chevron_right
burp-suite
chevron_right
page-behavior-audit
chevron_right

Build your own?

Join 12,000+ developers contributing to the Claude ecosystem.