Skip to content

[ISSUE #12833]✨Encode numeric message properties from stack buffers - #12844

Merged
mxsm merged 1 commit into
mainfrom
mxsm/cs-06-numeric-properties
Nov 20, 2026
Merged

mxsm merged 1 commit into
mainfrom
mxsm/cs-06-numeric-properties

Conversation

@mxsm

@mxsm mxsm commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Which Issue(s) This PR Fixes(Closes)

Brief Description

Format integer properties with a stack-backed itoa buffer and construct the final CheetahString directly. Apply the helper to pull offsets, timer routing, batch counts and extended timeline fields.

How Did You Test This Change?

  • cargo test --locked -p rocketmq-model -p rocketmq-protocol --lib passed, including decimal display parity for signed and unsigned boundaries.
  • cargo test --locked -p rocketmq-broker --lib hook_utils passed.
  • cargo test --locked -p rocketmq-store --features extended_timeline --test timer_extended_delivery_tests passed.

Broker workload measurements

Compared the Broker at 391ed3e31 with the combined runtime changes through this PR. Both variants used Rust 1.95.0, fat LTO, mimalloc, the same PGO input and separately trained BOLT layouts. Each scenario ran in fresh containers with the same client, NameServer and 1 KiB payload. Allocator runs used A, B, B, A order. Hardware runs repeated this sequence in reverse variant order for a total of four measurements per variant. The table reports means per completed message.

Scenario Allocator entry calls Retired instructions CPU cycles
4 sessions, 64 in flight each 54.68 to 53.04 (-3.0%) 131,657 to 131,487 (-0.1%) 213,637 to 203,786 (-4.6%)
16 sessions, 16 in flight each 54.64 to 54.11 (-1.0%) 134,914 to 134,665 (-0.2%) 218,213 to 218,617 (+0.2%)
Synchronous send 66.68 to 65.20 (-2.2%) 186,574 to 186,990 (+0.2%) 399,055 to 453,970 (+13.8%)
LitePull consumption 3.03 to 2.99 (-1.1%) 7,651 to 7,613 (-0.5%) 14,135 to 14,275 (+1.0%)

Hardware counters cover user and kernel execution in Broker threads during the client-reported measurement window. Boundary counts are interpolated from samples at approximately 8 ms intervals. The LitePull window starts after seeding. Allocator counts came from separate runs tracing the mimalloc aligned allocation, zeroed allocation and reallocation entry points. All measured messages completed successfully. CPU cycles varied across paired runs, especially for synchronous sends.

Three of the four synchronous pairs used fewer cycles with the changes. One pair rose from 369k to 681k cycles and raised the arithmetic mean. In two additional synchronous pairs after local compilation finished, the means were 395,912 and 479,884 cycles per message (+21.2%). Both follow-up pairs were higher with the changes. The increase in both aggregate comparisons flags a synchronous-send cycle regression risk for this combined build.

@mxsm
mxsm merged commit 83da1b3 into main Nov 20, 2026
20 of 21 checks passed
@mxsm
mxsm deleted the mxsm/cs-06-numeric-properties branch November 20, 2026 15:34
@rocketmq-rust-bot

Copy link
Copy Markdown
Collaborator

🔊@mxsm 🚀Thanks for your contribution🎉!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement✨] Encode numeric message properties from stack buffers

3 participants