Skip to content
mycli.usage.kdl
name "mycli"
flag "-v --verbose" help="Enable verbose output"
arg "<file>" help="File to process"
cmd "deploy" { flag "--env <env>" }

Benchmarks

Parser overhead

What parsing mise use -g node@20 costs each framework, against a shadow of mise's CLI: 211 commands, 711 flags. The usage, clap, bpaf, and cobra programs are generated from the same checked-in spec; urfave/cli and kong are still hand-measured.

usage-rs vs clap, bpaf

wall time, in-process parse throughput How this is measured Each parser runs repeatedly inside one process; process startup is excluded, so these bars are not full CLI invocation times. The chart reports the fastest per-parse time from many short rounds. Minima and their ratios drift a few percent between runs and machines, hence the ~. Instructions for one cold parse, which do not drift: 4,155 · 5.89M · 21.9M, agreeing across two machines to 0.15%.

usage-rs190 ns
clap480 µs · ~2,500× more
bpaf1.6 ms · ~8,200× more

usage-rs starts from compiler-emitted static tables and scans only the current command's flags plus inherited globals. clap and bpaf build a parser before they can use one Where their time goes Most of clap's is constructing and validating its command tree. bpaf's is larger because it assembles a combinator tree per run as well, which reusing the parser across parses only halves. . Heap allocations for a bare parse: zero, against clap's 6,560.

usage-go vs cobra, urfave/cli, kong

wall time, startup-adjusted process cost How this is measured Whole-process wall time with the ~950 µs startup cost of a do-nothing Go process subtracted. usage-go and cobra have generated mise-scale shadows; urfave/cli and kong are hand-measured and should be read as orders of magnitude. The subtraction makes every bar approximate.

usage-go~150 µs
urfave/cli v3~750 µs · ~5× more
cobra~1.05 ms · ~7× more
kong~5.2 ms · ~35× more

The measured event parser walks package-level tables already laid out before main: no runtime tree construction, reflection, or heap allocation. Instructions for the same parse: ~1.6k vs cobra's 3.25M, urfave/cli's 5.6M, kong's 57.9M.

Methodology and raw numbers: go/README.md · tasks/perf-shadow.sh · time-sweep.rs

MIT LicenseCopyright © 2026jdx.dev