Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1839 +/- ##
=======================================
Coverage 91.78% 91.78%
=======================================
Files 101 101
Lines 20565 20584 +19
=======================================
+ Hits 18875 18894 +19
Misses 1690 1690 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR adjusts the check-yaml pre-commit hook’s YAML parser configuration to tolerate YAML files that use many aliases referencing few anchors (common in docker-compose style configs), while adding a regression test to ensure such files validate successfully.
Changes:
- Disable serde-saphyr’s alias/anchor ratio enforcement specifically for the
check-yamlhook by setting an explicitBudget. - Add a regression test that constructs YAML with many aliases and a single anchor and asserts it passes validation.
📦 Cargo Bloat ComparisonBinary size change: +0.00% (24.9 MiB → 24.9 MiB) Expand for cargo-bloat outputHead Branch ResultsBase Branch Results |
⚡️ Hyperfine BenchmarksSummary: 0 regressions, 0 improvements above the 10% threshold. Environment
CLI CommandsBenchmarking basic commands in the main repo:
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base --version |
2.4 ± 0.1 | 2.3 | 2.6 | 1.00 |
prek-head --version |
2.4 ± 0.1 | 2.3 | 2.7 | 1.02 ± 0.04 |
prek list
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base list |
9.8 ± 0.4 | 9.0 | 10.8 | 1.01 ± 0.06 |
prek-head list |
9.7 ± 0.4 | 8.9 | 10.5 | 1.00 |
prek validate-config .pre-commit-config.yaml
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base validate-config .pre-commit-config.yaml |
3.3 ± 0.1 | 3.1 | 3.6 | 1.03 ± 0.04 |
prek-head validate-config .pre-commit-config.yaml |
3.2 ± 0.1 | 3.1 | 3.5 | 1.00 |
prek sample-config
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base sample-config |
2.7 ± 0.1 | 2.6 | 2.9 | 1.01 ± 0.04 |
prek-head sample-config |
2.7 ± 0.1 | 2.5 | 2.9 | 1.00 |
Cold vs Warm Runs
Comparing first run (cold) vs subsequent runs (warm cache):
prek run --all-files (cold - no cache)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run --all-files |
161.1 ± 1.6 | 159.2 | 163.5 | 1.00 |
prek-head run --all-files |
163.1 ± 3.6 | 155.8 | 168.2 | 1.01 ± 0.02 |
prek run --all-files (warm - with cache)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run --all-files |
159.8 ± 2.9 | 154.9 | 163.9 | 1.01 ± 0.03 |
prek-head run --all-files |
157.7 ± 3.1 | 153.2 | 163.6 | 1.00 |
Full Hook Suite
Running the builtin hook suite on the benchmark workspace:
prek run --all-files (full builtin hook suite)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run --all-files |
159.8 ± 4.5 | 152.7 | 171.5 | 1.00 |
prek-head run --all-files |
164.1 ± 5.6 | 155.9 | 191.7 | 1.03 ± 0.05 |
Individual Hook Performance
Benchmarking each hook individually on the test repo:
prek run trailing-whitespace --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run trailing-whitespace --all-files |
23.3 ± 0.8 | 21.8 | 25.6 | 1.02 ± 0.05 |
prek-head run trailing-whitespace --all-files |
22.8 ± 0.7 | 21.7 | 23.9 | 1.00 |
prek run end-of-file-fixer --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run end-of-file-fixer --all-files |
29.4 ± 1.8 | 26.0 | 32.6 | 1.00 |
prek-head run end-of-file-fixer --all-files |
29.4 ± 1.8 | 26.3 | 33.8 | 1.00 ± 0.09 |
prek run check-json --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-json --all-files |
14.5 ± 1.4 | 12.4 | 17.3 | 1.15 ± 0.12 |
prek-head run check-json --all-files |
12.6 ± 0.5 | 11.7 | 13.6 | 1.00 |
prek run check-yaml --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-yaml --all-files |
12.7 ± 0.3 | 12.3 | 13.4 | 1.01 ± 0.03 |
prek-head run check-yaml --all-files |
12.5 ± 0.3 | 12.1 | 13.1 | 1.00 |
prek run check-toml --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-toml --all-files |
12.9 ± 0.5 | 12.3 | 14.3 | 1.00 |
prek-head run check-toml --all-files |
13.1 ± 0.5 | 12.2 | 14.2 | 1.02 ± 0.05 |
prek run check-xml --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-xml --all-files |
12.8 ± 0.4 | 11.9 | 13.7 | 1.00 |
prek-head run check-xml --all-files |
13.4 ± 0.5 | 12.7 | 14.6 | 1.04 ± 0.05 |
prek run detect-private-key --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run detect-private-key --all-files |
19.6 ± 1.6 | 17.3 | 23.2 | 1.00 |
prek-head run detect-private-key --all-files |
19.7 ± 1.3 | 17.6 | 22.1 | 1.00 ± 0.11 |
prek run fix-byte-order-marker --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run fix-byte-order-marker --all-files |
25.1 ± 1.5 | 22.1 | 28.2 | 1.00 |
prek-head run fix-byte-order-marker --all-files |
25.4 ± 1.4 | 22.1 | 27.5 | 1.01 ± 0.08 |
Installation Performance
Benchmarking hook installation (fast path hooks skip Python setup):
prek install-hooks (cold - no cache)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base install-hooks |
5.0 ± 0.1 | 4.9 | 5.0 | 1.00 |
prek-head install-hooks |
5.2 ± 0.1 | 5.0 | 5.3 | 1.04 ± 0.02 |
prek install-hooks (warm - with cache)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base install-hooks |
5.0 ± 0.1 | 4.9 | 5.1 | 1.03 ± 0.02 |
prek-head install-hooks |
4.8 ± 0.1 | 4.8 | 4.9 | 1.00 |
File Filtering/Scoping Performance
Testing different file selection modes:
prek run (staged files only)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run |
54.4 ± 1.4 | 52.7 | 58.7 | 1.00 |
prek-head run |
54.9 ± 1.5 | 52.7 | 58.2 | 1.01 ± 0.04 |
prek run --files '*.json' (specific file type)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run --files '*.json' |
9.7 ± 0.5 | 9.1 | 10.9 | 1.00 |
prek-head run --files '*.json' |
9.8 ± 0.4 | 9.2 | 10.4 | 1.01 ± 0.07 |
Workspace Discovery & Initialization
Benchmarking hook discovery and initialization overhead:
prek run --dry-run --all-files (measures init overhead)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run --dry-run --all-files |
14.9 ± 0.6 | 14.0 | 15.9 | 1.01 ± 0.07 |
prek-head run --dry-run --all-files |
14.7 ± 0.8 | 14.0 | 16.8 | 1.00 |
Meta Hooks Performance
Benchmarking meta hooks separately:
prek run check-hooks-apply --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-hooks-apply --all-files |
14.7 ± 0.5 | 14.2 | 15.7 | 1.02 ± 0.05 |
prek-head run check-hooks-apply --all-files |
14.4 ± 0.5 | 13.9 | 15.5 | 1.00 |
prek run check-useless-excludes --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-useless-excludes --all-files |
12.7 ± 0.3 | 12.3 | 13.4 | 1.00 |
prek-head run check-useless-excludes --all-files |
12.9 ± 0.5 | 12.3 | 13.7 | 1.01 ± 0.05 |
prek run identity --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run identity --all-files |
11.4 ± 0.5 | 10.9 | 12.2 | 1.01 ± 0.05 |
prek-head run identity --all-files |
11.3 ± 0.4 | 10.9 | 12.0 | 1.00 |
|
Thank you! I'll be waiting for the release :) |
Disable serde-saphyr's alias/anchor ratio heuristic for the check-yaml hook while keeping the other parser budgets
Closes #1838