-
Notifications
You must be signed in to change notification settings - Fork 174
perf: inline functions of broker_bootstrap.rs #4042
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughAdded #[inline] attributes to two private methods of BrokerBootstrap (initialize and start) in rocketmq-broker/src/broker_bootstrap.rs. Method signatures and bodies are unchanged; they still await calls to broker_runtime.initialize() and broker_runtime.start(). Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal). Please share your feedback with us on this Discord post. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🔊@Parizval 🚀Thanks for your contribution🎉! 💡CodeRabbit(AI) will review your code first🔥! Note 🚨The code review suggestions from CodeRabbit are to be used as a reference only, and the PR submitter can decide whether to make changes based on their own judgment. Ultimately, the project management personnel will conduct the final code review💥. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4042 +/- ##
=======================================
Coverage 26.51% 26.51%
=======================================
Files 568 568
Lines 80867 80867
=======================================
Hits 21440 21440
Misses 59427 59427 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (4)
rocketmq-broker/src/broker_bootstrap.rs (4)
69-76
: Unnecessary #[inline] on Builder::new; out of scope of linked issue.Builder constructors aren’t in hot paths and this wasn’t requested by #3938. Suggest reverting to reduce attribute noise.
- #[inline] pub fn new() -> Self {
77-81
: Drop #[inline] on set_broker_config.Tiny setter; no evidence of benefit. Keep code lean unless profiling says otherwise.
- #[inline] pub fn set_broker_config(mut self, broker_config: BrokerConfig) -> Self {
82-86
: Drop #[inline] on set_message_store_config.Same rationale as above.
- #[inline] pub fn set_message_store_config(mut self, message_store_config: MessageStoreConfig) -> Self {
92-101
: Drop #[inline] on build.Not performance-critical; removing keeps attributes focused on the intended targets.
- #[inline] pub fn build(self) -> BrokerBootstrap {
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
rocketmq-broker/src/broker_bootstrap.rs
(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
rocketmq-broker/src/broker_bootstrap.rs (1)
rocketmq-broker/src/broker_runtime.rs (1)
initialize
(444-456)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
- GitHub Check: build (windows-latest, nightly)
- GitHub Check: build (macos-latest, nightly)
- GitHub Check: test
- GitHub Check: build (ubuntu-latest, stable)
- GitHub Check: build (windows-latest, stable)
- GitHub Check: build (macos-latest, stable)
- GitHub Check: build
- GitHub Check: build (ubuntu-latest, nightly)
- GitHub Check: auto-approve
🔇 Additional comments (2)
rocketmq-broker/src/broker_bootstrap.rs (2)
42-45
: OK to inline; fulfills issue intent. Note: async #[inline] usually has negligible effect.For async fns, #[inline] only hints inlining of the small future-constructor stub; the state machine isn’t inlined. Harmless, but unlikely to yield perf wins. If this was for measurable gains, please share a before/after bench.
46-49
: Same here: meets objective; practical impact likely minimal.Inlining the async start() wrapper is fine but probably not performance-relevant. Consider keeping only if you’ve profiled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Which Issue(s) This PR Fixes(Closes)
Fixes #3938
Brief Description
Adding inline to functions of broker_bootstrap.rs
How Did You Test This Change?
Summary by CodeRabbit
Refactor
Performance