rosetta-rs/argparse-rosetta-rs

Comparing argparse APIs

Python

195

307 commits

updated Sep 1, 2026

See the code

README

Rust Arg Parsing Benchmarks

This repo tries to assess Rust arg parsing performance.

We currently compare:

NameStyleNotes
No-opN/AN/A
arghderive
bpafCombinatoric or derive
clap_lexImperativeNo help generation
clapBuilder or deriveColor, suggested fixes, completions
gumdropderive
lexoptImperativeNo help generation
pico-argsImperativeNo help generation
xflagsproc-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

NameOverhead (release)Build (debug)Parse (release)Invalid UTF-8DownloadsVersion
null0 KiB163ms (full)
115ms (incremental)
1msY--
argh38 KiB4s (full)
138ms (incremental)
2msNDownload countv0.1.14
bpaf256 KiB831ms (full)
137ms (incremental)
2msYDownload countv0.9.23
bpaf_derive253 KiB4s (full)
140ms (incremental)
2msYDownload countv0.9.23
clap574 KiB3s (full)
170ms (incremental)
2msYDownload countv4.5.60
clap-minimal377 KiB2s (full)
155ms (incremental)
2msYDownload countv4.5.60
clap_derive596 KiB4s (full)
182ms (incremental)
2msYDownload countv4.5.60
clap_lex28 KiB336ms (full)
129ms (incremental)
2msYDownload countv1.0.0
gumdrop28 KiB2s (full)
135ms (incremental)
1msNDownload countv0.8.1
lexopt37 KiB329ms (full)
124ms (incremental)
2msYDownload countv0.3.2
pico-args24 KiB300ms (full)
123ms (incremental)
2msYDownload countv0.5.0
xflags23 KiB539ms (full)
123ms (incremental)
1msYDownload countv0.3.2

System: Linux 6.17.9-76061709-generic (x86_64), rustc 1.94.0 (4a4ef493e 2026-03-02) w/ -j 8

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

cli
rust

Contributors

epage

161 commits

RazrFalcon

49 commits

renovate[bot]

48 commits

dependabot[bot]

24 commits

rosetta-rs/argparse-rosetta-rs

Comparing argparse APIs

Python

195

307 commits

updated Sep 1, 2026

See the code

README

Rust Arg Parsing Benchmarks

This repo tries to assess Rust arg parsing performance.

We currently compare:

NameStyleNotes
No-opN/AN/A
arghderive
bpafCombinatoric or derive
clap_lexImperativeNo help generation
clapBuilder or deriveColor, suggested fixes, completions
gumdropderive
lexoptImperativeNo help generation
pico-argsImperativeNo help generation
xflagsproc-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

NameOverhead (release)Build (debug)Parse (release)Invalid UTF-8DownloadsVersion
null0 KiB163ms (full)
115ms (incremental)
1msY--
argh38 KiB4s (full)
138ms (incremental)
2msNDownload countv0.1.14
bpaf256 KiB831ms (full)
137ms (incremental)
2msYDownload countv0.9.23
bpaf_derive253 KiB4s (full)
140ms (incremental)
2msYDownload countv0.9.23
clap574 KiB3s (full)
170ms (incremental)
2msYDownload countv4.5.60
clap-minimal377 KiB2s (full)
155ms (incremental)
2msYDownload countv4.5.60
clap_derive596 KiB4s (full)
182ms (incremental)
2msYDownload countv4.5.60
clap_lex28 KiB336ms (full)
129ms (incremental)
2msYDownload countv1.0.0
gumdrop28 KiB2s (full)
135ms (incremental)
1msNDownload countv0.8.1
lexopt37 KiB329ms (full)
124ms (incremental)
2msYDownload countv0.3.2
pico-args24 KiB300ms (full)
123ms (incremental)
2msYDownload countv0.5.0
xflags23 KiB539ms (full)
123ms (incremental)
1msYDownload countv0.3.2

System: Linux 6.17.9-76061709-generic (x86_64), rustc 1.94.0 (4a4ef493e 2026-03-02) w/ -j 8

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

cli
rust

Contributors

epage

161 commits

RazrFalcon

49 commits

renovate[bot]

48 commits

dependabot[bot]

24 commits

Languages

Python

100.0%