Repository navigation
fix: use 'faster than beancount' labels in benchmark chart - #200
Conversation
- Updated validation-spec.json with correct text format: - Small bars: 'Nx faster · XX ms' - Large bars: 'Nx faster' (shorter to fit) - beancount: 'baseline' - Changed decimal format from .0f to .1f for accuracy (1.6x not 2x) - Refactored generate-bench-charts.py to use spec file as template instead of generating spec inline 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
There was a problem hiding this comment.
Pull request overview
This PR updates benchmark chart labels to compare all tools against beancount as a baseline, replacing the previous "Nx slower than rustledger" format with "Nx faster" comparisons. The refactoring also improves maintainability by using a centralized Vega spec template.
Changes:
- Changed label format from "slower than rustledger" to "faster than beancount" with beancount shown as "baseline"
- Updated decimal precision from
.0fto.1ffor more accurate speed comparisons - Refactored Python script to load and populate a Vega spec template instead of generating specs from scratch
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| scripts/generate-bench-charts.py | Refactored to use template-based approach with load_spec_template and populate_spec functions |
| .github/badges/validation-spec.json | Updated label text and width calculations to reflect new "faster than beancount" comparison format |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| # Generate validation chart | ||
| val_spec = generate_vega_bar_spec( | ||
| import copy |
There was a problem hiding this comment.
The copy module should be imported at the top of the file with other imports, not in the middle of the function. Move this import to line 24 with the other standard library imports.
| "y": {"scale": "y", "field": "label", "band": 0.5, "offset": -9}, | ||
| "x": {"signal": "datum.is_small ? scale('x', datum.time_ms) + 8 : 6"}, | ||
| "width": {"signal": "datum.is_small ? (datum.tool == 'rustledger' ? 155 : 130) : (datum.tool == 'rustledger' ? 85 : 68)"}, | ||
| "width": {"signal": "datum.is_small ? (datum.tool == 'beancount' ? 80 : 155) : (datum.tool == 'beancount' ? 50 : 115)"}, |
There was a problem hiding this comment.
The nested ternary operators for width calculation are difficult to read and maintain. Consider adding a comment explaining the width values for each case (small beancount, small other, large beancount, large other).
| "width": {"signal": "datum.is_small ? (datum.tool == 'beancount' ? 80 : 155) : (datum.tool == 'beancount' ? 50 : 115)"}, | |
| "width": {"signal": "if(datum.tool == 'beancount', if(datum.is_small, 80, 50), if(datum.is_small, 155, 115))"}, |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
🧪 CI InsightsHere's what we observed from your CI run for 391a218. 🟢 All jobs passed!But CI Insights is watching 👀 |
Fixes code-scanning alert #200 (actions/unpinned-tag): the wasmtime setup step used the mutable v1 tag — copied from rustfava's workflow, which doesn't enforce this repo's pin-by-SHA convention. Pinned to the commit v1 currently resolves to, with the usual version comment. Co-authored-by: Claude Opus 4.8 <[email protected]>
Summary
.0fto.1ffor accuracy (shows 1.6x instead of rounding to 2x)generate-bench-charts.pyto usevalidation-spec.jsonas templateTest plan
🤖 Generated with Claude Code