Repository navigation
test(bench): add criterion benchmarks - #1682
Merged
Merged
Conversation
Add a reproducible benchmark suite: - git-cliff: end-to-end changelog generation against repositories generated at startup (linear history, a tag every 10 commits) with 10, 50 and 200 tags. - git-cliff-core: commit processing for 10/100/1000 releases and rendering with the built-in templates, without touching git. Run with `cargo bench -p <crate> --bench changelog`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1682 +/- ##
==========================================
- Coverage 54.00% 53.97% -0.03%
==========================================
Files 29 29
Lines 2676 2676
==========================================
- Hits 1445 1444 -1
- Misses 1231 1232 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a reproducible benchmark suite, as proposed in #1338. Run it with:
git-cliff/benches/changelog.rsrunsgit_cliff::runandwrite_changelog(with thekeepachangelogbuilt-in config) against repositories generated at startup withgit2: a linear history with a tag every 10 commits, at 10, 50 and 200 tags. Nothing large is committed and the inputs are the same on every machine.git-cliff-core/benches/changelog.rscoversChangelog::new(conventional parsing, commit parsers, link parsers) for 10/100/1000 releases, and rendering 100 releases with thekeepachangelog,detailedandscopedtemplates. It doesn't touch git.New dev-dependencies:
criterion0.8 (default features off, so no rayon or plotters), plusgit2in the CLI crate (already a dependency of the core crate, same version).--bench changelogis needed because a plaincargo bench -p ...also runs the libtest harness of the lib target, which rejects criterion's flags.Criterion was picked over divan for its
--save-baseline/--baselinecomparison between main and a feature branch, as discussed in the issue.Motivation and Context
Closes #1338. The end-to-end bench is shaped to catch regressions like #1668. On a GitHub
ubuntu-22.04runner, main vs. main with #1673 merged:How Has This Been Tested?
On a GitHub Actions
ubuntu-22.04runner:cargo +nightly fmt --all -- --check,cargo clippy --tests --benches -- -D warnings, the pedantic clippy command fromci.yml(no warnings in the new files), and both benches.Not wired into CI in this PR. Happy to add an informational job if you'd like.
Performance
Only adds dev-dependencies and bench targets, so the built
git-cliffbinary and library are unchanged.Types of Changes
Checklist:
cargo +nightly fmt --allcargo clippy --tests --verbose -- -D warningscargo test