Skip to content

fix: use 'faster than beancount' labels in benchmark chart - #200

Merged
robcohen merged 1 commit into
mainfrom
fix/benchmark-labels
Jan 23, 2026
Merged

robcohen merged 1 commit into
mainfrom
fix/benchmark-labels

Conversation

@robcohen

Copy link
Copy Markdown
Member

Summary

  • Updated benchmark chart labels to show "Nx faster" instead of "Nx slower than rustledger"
  • All tools now compared to beancount baseline:
    • rustledger: "26.2x faster · 34 ms"
    • ledger: "7.9x faster · 113 ms"
    • hledger: "1.6x faster" (inside bar)
    • beancount: "baseline"
  • Changed decimal format from .0f to .1f for accuracy (shows 1.6x instead of rounding to 2x)
  • Refactored generate-bench-charts.py to use validation-spec.json as template

Test plan

  • Previewed in Vega Editor - labels fit correctly
  • Next nightly benchmark run will use new labels

🤖 Generated with Claude Code

- 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]>
@robcohen
robcohen requested a review from a team as a code owner January 23, 2026 03:35
Copilot AI review requested due to automatic review settings January 23, 2026 03:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 .0f to .1f for 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

Copilot AI Jan 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
"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)"},

Copilot AI Jan 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
"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))"},

Copilot uses AI. Check for mistakes.
@codecov

codecov Bot commented Jan 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@robcohen
robcohen added this pull request to the merge queue Jan 23, 2026
@mergify

mergify Bot commented Jan 23, 2026 •

Copy link
Copy Markdown
Contributor

🧪 CI Insights

Here's what we observed from your CI run for 391a218.

🟢 All jobs passed!

But CI Insights is watching 👀

Merged via the queue into main with commit be8962f Jan 23, 2026
@robcohen
robcohen deleted the fix/benchmark-labels branch January 23, 2026 03:42
robcohen added a commit that referenced this pull request Jul 2, 2026
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]>
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.

2 participants