GitHub - rosetta-rs/argparse-rosetta-rs: Comparing argparse APIs (original) (raw)
Rust Arg Parsing Benchmarks
This repo tries to assess Rust arg parsing performance.
We currently compare:
Name | Style | Notes |
---|---|---|
No-op | N/A | N/A |
argh | derive | |
bpaf | Combinatoric or derive | |
clap_lex | Imperative | No help generation |
clap | Builder or derive | Color, suggested fixes, completions |
gumdrop | derive | |
lexopt | Imperative | No help generation |
pico-args | Imperative | No help generation |
xflags | proc-macro |
See also an examination of design trade offs
Note: any non-performance comparison is meant to provide context for what you gain/lose with each crate's overhead. For a full comparison, see each parser docs
Results
System: Linux 5.4.0-124-generic (x86_64) w/ -j 8
rustc: rustc 1.72.0 (5680fa18f 2023-08-23)
Notes:
- Overhead will be lower if your application shares dependencies with your argument parsing library.
Running the Benchmarks
$ ./bench.py $ ./format.py
To be included, the crate needs meet one of the following criteria:
- 10k+ recent downloads
- Unique API design
Special Thanks
- RazrFalcon for creating the initial benchmarks
- djc for inspiration with template-benchmarks-rs
- sharkdp for hyperfine