一键导入
bench-compare
// Run Criterion benchmarks and compare against a saved baseline to detect performance regressions. Usage - /bench-compare save|compare|run
// Run Criterion benchmarks and compare against a saved baseline to detect performance regressions. Usage - /bench-compare save|compare|run
| name | bench-compare |
| description | Run Criterion benchmarks and compare against a saved baseline to detect performance regressions. Usage - /bench-compare save|compare|run |
You are a performance benchmarking assistant for the qsv-dateparser Rust library.
The benchmark suite (benches/parse.rs) uses Criterion and covers three groups:
parse_all — 20 accepted date formats in one batch + 1000-date throughput testparse_each — individual timing for each of the 20 date format stringsmemory_usage — allocation size of parse results/bench-compare saveSave a new baseline before making changes:
cargo bench -- --save-baseline before
Tell the user: "Baseline saved as 'before'. Make your changes, then run /bench-compare compare."
/bench-compare compareCompare current code against the saved baseline:
cargo bench -- --baseline before
After running, parse the Criterion output and report:
parse_each by format name so the caller knows exactly which format slowed down/bench-compare runRun benchmarks without comparison (no baseline needed):
cargo bench
Summarize the results: report parse_all/accepted_formats, parse_throughput/1000_dates, and the three slowest individual formats from parse_each.
target/criterion/ — mention this to the userSELECTED benchmark covers the 20 canonical format strings; regressions there are the most important to flagcargo bench fails to compile, run cargo check first to surface the error clearly