Skip to content

docs: regenerate benchmark charts with all 7 set implementations #none - #45

Open
freeformz wants to merge 1 commit into
mainfrom
bench-charts-all-impls
Open

docs: regenerate benchmark charts with all 7 set implementations #none#45
freeformz wants to merge 1 commit into
mainfrom
bench-charts-all-impls

Conversation

@freeformz

Copy link
Copy Markdown
Owner

Summary

The README's performance graphs only showed 5 of the 7 set implementations: the committed bench_stats.csv predated SortedSet and BitSet, and bench_plot.py silently dropped any implementation missing from its hardcoded IMPL_ORDER list.

  • benchmarks/regenerate.sh (new): one-step regeneration of the CSV and all charts. Runs TestBenchStats across every implementation registered in benchImpls, so future set types are picked up automatically. Supports --plot-only to re-plot from the existing CSV, and falls back to uv run --with matplotlib when matplotlib isn't installed.
  • bench_plot.py: covers all 7 implementations; warns and plots (in black) any implementation found in the CSV but missing from IMPL_ORDER instead of silently dropping it; switches to a colorblind-safe categorical palette (validated: adjacent-pair CVD ΔE ≥ 8) with distinct per-series markers; y-axis is now log scale — the series span ~4 orders of magnitude (word-wise BitSet ops vs element-wise iteration), which a linear axis flattened into the x-axis.
  • Regenerated bench_stats.csv and all 11 charts from a fresh full run (sizes 10 → 1,000,000, 30 samples/op). BitSet appears in the int panels only (integer-only implementation, as documented).
  • README: benchmark section now leads with the regeneration script.

Verification

  • ./benchmarks/regenerate.sh --plot-only reproduces the committed charts from the committed CSV.
  • CSV impl column contains all 7 implementations; charts eyeballed — every series visible and distinguishable in both int and string panels.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VjUKQx2QYDuetR8z8GkGyU

The committed bench_stats.csv and charts predated SortedSet and BitSet, and
bench_plot.py silently dropped any implementation missing from its hardcoded
IMPL_ORDER list, so the README graphs only showed 5 of the 7 set types.

- add benchmarks/regenerate.sh: one-step CSV + chart regeneration
  (with --plot-only mode and a uv fallback when matplotlib isn't installed)
- bench_plot.py: cover all 7 implementations, warn-and-plot unknown ones
  instead of dropping them, switch to a colorblind-safe palette with
  per-series markers, and use a log y-axis so the fast-path implementations
  are visible alongside the element-wise ones
- regenerate bench_stats.csv and all 11 charts with all implementations

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VjUKQx2QYDuetR8z8GkGyU
Copilot AI review requested due to automatic review settings July 28, 2026 19:55

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

Updates the benchmark documentation and artifacts so the README charts reflect all 7 set implementations (including SortedSet and BitSet) and can be regenerated reliably going forward.

Changes:

  • Add benchmarks/regenerate.sh to regenerate bench_stats.csv and re-render charts in one step (with a --plot-only mode).
  • Update benchmarks/bench_plot.py to include all implementations, avoid silently dropping unknown series, add markers + a colorblind-safe palette, and switch the y-axis to log scale.
  • Regenerate benchmarks/bench_stats.csv with fresh benchmark results including all implementations.

Reviewed changes

Copilot reviewed 3 out of 15 changed files in this pull request and generated 2 comments.

File Description
README.MD Adds a quick “regenerate benchmarks” section pointing to the new script.
benchmarks/regenerate.sh New helper script to (re)generate the benchmark CSV and charts.
benchmarks/bench_stats.csv Updated benchmark dataset used to produce the README charts.
benchmarks/bench_plot.py Updates plotting to handle all implementations and improve chart readability.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread benchmarks/bench_plot.py
Comment on lines 88 to 92
type_data = [r for r in op_data if r['type'] == typ]

for impl in IMPL_ORDER:
for impl in IMPL_ORDER + extra_impls:
impl_data = sorted(
[r for r in type_data if r['impl'] == impl],
Comment thread README.MD
Comment on lines +111 to +113
To regenerate `benchmarks/bench_stats.csv` and the charts below in one step (requires
python3 + matplotlib; the benchmark step takes on the order of an hour):

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