Skip to content

ci(release): enable mimalloc in release rledger binaries (-7% load) - #1601

Merged
robcohen merged 2 commits into
mainfrom
perf/release-mimalloc
Jun 25, 2026
Merged

robcohen merged 2 commits into
mainfrom
perf/release-mimalloc

Conversation

@robcohen

Copy link
Copy Markdown
Member

What

Enables the mimalloc global allocator in the release rledger binaries (the -7% load win from #1599), for native targets.

Why

#1599 added mimalloc as an opt-in feature (correctly non-default, so it doesn't force a C dep on library consumers). But the release pipeline builds with --no-default-features, so the win wasn't reaching shipped binaries. This wires --features mimalloc into those builds.

How

Append --features mimalloc to the rledger build commands in release-build.yml:

  • PGO Unix + Windows (cargo pgo build / cargo pgo optimize build)
  • native non-cross (cargo build --profile …)

Cross targets intentionally excluded

mimalloc is a vendored C library; its cross build (musl / Windows-ARM / …) under cross isn't validated here, and a release shouldn't hinge on it. Cross-compiled targets ship without the allocator (no win, no risk); native targets get it. rledger-lsp / ag-rledger are separate binaries and unaffected.

Verification

🤖 Generated with Claude Code

Follow-up to #1599 (mimalloc opt-in feature) + #1600. The release builds use
--no-default-features, so the opt-in feature wasn't reaching shipped binaries.
Add --features mimalloc to the rledger builds (PGO Unix/Windows + native
non-cross) so released binaries get the ~7% lower-load allocator win.

Cross-compiled targets are intentionally excluded: mimalloc's vendored C build
isn't validated under cross here, and a release shouldn't hinge on it — they
ship without the allocator. Feature resolution verified locally (cargo build
--no-default-features --features mimalloc resolves at the virtual workspace
root); rledger output is unchanged (allocator-only).
Copilot AI review requested due to automatic review settings June 25, 2026 21:35
@robcohen
robcohen requested a review from a team as a code owner June 25, 2026 21:35
@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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 release CI workflow so native rledger release binaries are built with the opt-in mimalloc allocator feature, restoring the performance win introduced in #1599 while keeping cross-compiled targets unchanged (to avoid unvalidated C cross-build risk).

Changes:

  • Add --features mimalloc to the Unix and Windows PGO build/optimize steps for rledger.
  • Add --features mimalloc to the native (non-cross) non-PGO cargo build path in the release workflow.
  • Document (in-workflow) why cross targets intentionally do not enable mimalloc.

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

Comment thread .github/workflows/release-build.yml Resolved
@github-actions

Copy link
Copy Markdown
Contributor

✅ Compatibility Test Results

Metric Result
Check Compatibility 100%
BQL Compatibility 100%
Full AST Match 100%
Total Files 792
What's tested
  • Check: Exit codes and error counts match bean-check
  • BQL: Query results match bean-query
  • Files: ~800 test files downloaded from 10+ beancount repositories

Full results available in workflow artifacts

@robcohen

Copy link
Copy Markdown
Member Author

Good point — tightened in the latest push. Reworded the cross-branch note to say plainly "Cross-compiled targets: NO mimalloc" and labeled the non-cross else branch "Native (non-cross) target: mimalloc enabled", dropping the ambiguous "PGO + non-cross" phrasing from inside the non-PGO step.

@robcohen
robcohen merged commit ea820ba into main Jun 25, 2026
37 checks passed
@robcohen
robcohen deleted the perf/release-mimalloc branch June 25, 2026 22:39
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