[Rust] Inline generated header methods#1110
Merged
vyazelenko merged 1 commit intoJun 12, 2026
Merged
Conversation
Contributor
|
@mward Can you please have a look? Thanks. |
Contributor
Author
|
@vyazelenko Friendly ping on this PR. @mward added a +1 reaction to your review request, but there is no formal approval recorded. Could you please confirm whether anything else is needed before this can move forward? |
Contributor
|
Sorry, not had chance to look yet. I'll do my best to review it tonight or early tomorrow. |
Contributor
|
this looks good! Thanks! |
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.
Summary
Add
#[inline]to the Rust generator output for message-levelheadermethods on both encoders and decoders.The generated API and behavior are unchanged. This only adds an inline hint to the small hot-path methods that bridge generated message encoders/decoders and the generated message header codec.
Benchmark Results
Environment:
Commands:
gradle generateRustCodecs cd rust cargo bench --bench header_benchmark -- --warm-up-time 1 --measurement-time 10 --save-baseline no-inline-header cargo bench --bench header_benchmark -- --warm-up-time 1 --measurement-time 10 --baseline no-inline-header cargo bench --bench car_benchmark -- --warm-up-time 1 --measurement-time 10 cargo bench --bench md_benchmark -- --warm-up-time 1 --measurement-time 10Focused header benchmark:
rust/message_header/car_encode_headerrust/message_header/car_decode_headerrust/message_header/md_encode_headerrust/message_header/md_decode_headerExisting Rust example benchmarks:
encode cardecode carencode mddecode mdValidation
gradle generateRustCodecs gradle runRustTests gradle :sbe-tool:test --tests '*rust*' rustfmt --check rust/benches/header_benchmark.rsBenchmark Code
Local benchmark helper used for the focused header benchmark