I want to benchmark derive macros, both in synthetic and real use cases.
By "real", I mean measuring how quickly a basic Rust program (including procedural macros) binary compile.
cargo build --timings command could be use, is there a specialized tool or method specifically designed for benchmarking procedural macros (derive macros) ?
the compile time of the proc macro itself (maybe split into dependencies and self),
the runtime of the proc macro for a given input
and the compile time of the generated code.
The first is only relevant for fresh builds while the latter is also impacting incremental builds. I suspect that the compile time of the generated code dominates the runtime of the proc macro in most cases since most time is spend in LLVM.
trybuild is specifically for testing whether small pieces of code (that use proc macros, even!) compile successfully or not. It's not meant for benchmarking, but you could time its whole run, or take inspiration from its code as to how to set up the build.