Repository navigation
[ISSUE #12220]✨Build release binaries with whole-program LTO and offer mimalloc for server images - #12221
Merged
Conversation
…r mimalloc for server images
Collaborator
|
🔊@mxsm 🚀Thanks for your contribution🎉! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which Issue(s) This PR Fixes(Closes)
Brief Description
Two build-level changes for the server binaries:
Cargo.tomlgains[profile.release]withlto = "fat"andcodegen-units = 1, so per-message code that crosses the protocol, transport, broker, and store crates can be inlined across crates. CI does not run release builds; only local release builds and image builds take longer.rocketmq-broker,rocketmq-namesrv,rocketmq-controller, androcketmq-proxyget an optionalallocator-mimallocfeature backed by a new workspace dependencymimalloc = "0.1.52". With the feature on, each binary entrypoint declaresmimalloc::MiMallocas its#[global_allocator]. The feature is not a default, so default builds and library users keep the system allocator.distribution/config/production-feature-profile.jsonand the four matchingdocker/Dockerfile.basebuild commands enableallocator-mimalloc, so production images use it;resolved_featuresstays sorted as the release-state guard requires.Cargo.lockaddsmimallocandlibmimalloc-sys. Adding the dependency made Cargo re-resolve, which moved six Windows-onlywindows-sysedges to the0.61.2already in the lockfile; no other package was added or removed. Standalone lockfiles do not change because the feature is not enabled there.Release-build microbenchmark of the protocol hot paths on an 8-core x86_64 host (single thread,
rocketmq-protocolandrocketmq-model):How Did You Test This Change?
cargo check -p <package> --bins --features allocator-mimallocforrocketmq-broker,rocketmq-namesrv,rocketmq-controller, androcketmq-proxy: passed.cargo build --release -p rocketmq-broker --features allocator-mimalloc --bin rocketmq-broker-rustwith the new profile: succeeded in 9 min 29 s on 16 threads, and the binary starts (--help).python -B -m unittest scripts/tests/test_p3_production_release_state.py: 6 of 7 passed, includingtest_production_features_are_explicit_and_resolve_exactly.test_validate_only_accepts_complete_state_and_rejects_secret_materialfails identically onmainon this Windows host (subprocess output decoding), so it is unrelated.cargo fmtcheck for the four packages: passed.🤖 Generated with Claude Code