Improving build times for derive macros by 3x or more

133 points kodewerx

Link to the article: BlogWerx: Improving build times for derive macros by 3x or more (kodewerx.org)

TL;DR:

  • I rewrote my proc-macro crates and improved the initial build time by just over 3x across 3 platforms.
  • Officially announcing the crates:
    • myn: Minimalist Rust syntax parsing for procedural macros.
    • onlyerror: Obsessively tiny error derive macro.
    • onlyargs: Only argument parsing! Nothing more.
    • onlyargs\_derive: Derive macro for onlyargs.