Skip to content

[codex] fold math microbenchmark into rust_api_benchmarking#846

Draft
MilkBlock wants to merge 1 commit intoegraphs-good:mainfrom
MilkBlock:codex/math-microbench-pr
Draft

[codex] fold math microbenchmark into rust_api_benchmarking#846
MilkBlock wants to merge 1 commit intoegraphs-good:mainfrom
MilkBlock:codex/math-microbench-pr

Conversation

@MilkBlock
Copy link
Copy Markdown
Contributor

Summary

This change folds the Rust-rule math microbenchmark into the existing rust_api_benchmarking bench suite so it runs alongside the other Rust API hot-path benchmarks instead of living in a separate bench target.

It also cleans up the shared benchmark support by making run_math_microbenchmark_iters honor its iters parameter and by failing fast when Rust-rule registration itself fails during setup.

Root cause

The math microbenchmark had been added as a standalone [[bench]], which meant it was disconnected from the upstream Rust API benchmarking entrypoint that now carries the table-action hot-path cases. That made it harder to compare and maintain these Rust API microbenchmarks together.

The support helper also hard-coded eight iterations regardless of the caller input, which made the API misleading and hid issues in tests that expected to control iteration count.

Fix

The math support module is now imported directly by benches/rust_api_benchmarking.rs, and a new rust_rule_math_microbenchmark divan bench is registered there.

A small test file exercises the setup path and one benchmark iteration, including the case where the global Rayon pool has already been initialized.

Validation

  • cargo test --test rust_api_math_microbenchmark -- --nocapture
  • cargo bench --bench rust_api_benchmarking -- --list

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.31%. Comparing base (21b99b6) to head (c5d23e7).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #846      +/-   ##
==========================================
+ Coverage   86.26%   86.31%   +0.05%     
==========================================
  Files          85       85              
  Lines       23262    23262              
==========================================
+ Hits        20067    20079      +12     
+ Misses       3195     3183      -12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Apr 12, 2026

Merging this PR will not alter performance

✅ 38 untouched benchmarks
⏩ 190 skipped benchmarks1


Comparing MilkBlock:codex/math-microbench-pr (c5d23e7) with main (21b99b6)

Open in CodSpeed

Footnotes

  1. 190 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

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