Skip to content

feat: add Criterion benchmark suite for performance tracking#71

Merged
alvinreal merged 1 commit intomainfrom
fix/issue-32
Feb 22, 2026
Merged

feat: add Criterion benchmark suite for performance tracking#71
alvinreal merged 1 commit intomainfrom
fix/issue-32

Conversation

@alvinreal
Copy link
Owner

Adds a comprehensive benchmark suite using the criterion crate to track performance and detect regressions.

Benchmarks

Parsing (with throughput measurement)

  • JSON: 100 / 1,000 / 10,000 records
  • CSV: 100 / 1,000 / 10,000 rows
  • YAML: 100 / 1,000 / 10,000 records

Serialization

  • JSON (compact & pretty): 100 / 1,000 / 10,000 records
  • CSV: 100 / 1,000 / 10,000 rows
  • YAML: 100 / 1,000 / 10,000 records
  • TOML: 100 / 1,000 records (smaller due to TOML's table structure)

Format Conversion (end-to-end)

  • JSON → YAML: 100 / 1,000 / 10,000 records
  • CSV → JSON: 100 / 1,000 / 10,000 rows

Mapping Operations

  • Rename: single field rename across 100 / 1k / 10k records
  • Filter: where .active == true across 100 / 1k / 10k records
  • Complex: rename + set + drop + cast pipeline across 100 / 1k / 10k records

End-to-End

  • JSON → JSON with mapping (rename + where filter): 100 / 1k / 10k records

CI Integration

Adds .github/workflows/bench.yml that:

  • Runs on PRs to main
  • Executes all benchmarks with --output-format bencher
  • Uploads benchmark results + criterion HTML reports as artifacts

Usage

# Run all benchmarks
cargo bench

# Run specific benchmark group
cargo bench -- parse_json
cargo bench -- mapping_complex

# Quick benchmark (fewer iterations)
cargo bench -- --quick

Fixes #32

Adds a comprehensive benchmark suite using the criterion crate to track
performance across parsing, serialization, format conversion, and
mapping operations.

Benchmarks included:
- Parsing: JSON, CSV, YAML at 100/1k/10k records (with throughput)
- Serialization: JSON, JSON pretty, CSV, YAML, TOML
- Conversions: JSON→YAML, CSV→JSON end-to-end
- Mapping: rename, filter (where), complex multi-operation pipeline
- End-to-end: JSON→JSON with mapping (rename + filter)

Also adds a CI workflow (.github/workflows/bench.yml) that runs
benchmarks on PRs and uploads results as artifacts for regression
detection.

Fixes #32
@alvinreal alvinreal merged commit 783e280 into main Feb 22, 2026
7 checks passed
@alvinreal alvinreal deleted the fix/issue-32 branch February 22, 2026 18:39
@github-actions github-actions bot mentioned this pull request Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Performance benchmark suite

1 participant