Before Creating the Enhancement Request
Summary
Implement FastCodesHeader.encode()/decode() for SendMessageRequestHeader and SendMessageResponseHeader to eliminate reflection-based header serialization.
Motivation
SendMessageRequestHeader does not implement FastCodesHeader, so every send message request goes through makeCustomHeaderToNet() which uses reflection to serialize header fields into extFields. This creates per-RPC allocation (HashMap entries, String values from toString()) and CPU overhead from reflective field access.
With R1 (#10522) merged, the FastCodesHeader interface now provides writeLong/writeInt helpers that can write numeric fields directly without String.valueOf() allocation. Implementing encode()/decode() on send message headers eliminates the reflection path entirely.
Describe the Solution You'd Like
Implement encode() and decode() methods on:
SendMessageRequestHeader — 14 fields including Long/Integer types
SendMessageResponseHeader — 5 fields
SendMessageRequestHeaderV2 — fix decode() signature to match interface
Additional Context
Depends on R1 (#10522, merged). Related PRs: #10443, #10514, #10526.
Before Creating the Enhancement Request
Summary
Implement
FastCodesHeader.encode()/decode()forSendMessageRequestHeaderandSendMessageResponseHeaderto eliminate reflection-based header serialization.Motivation
SendMessageRequestHeaderdoes not implementFastCodesHeader, so every send message request goes throughmakeCustomHeaderToNet()which uses reflection to serialize header fields intoextFields. This creates per-RPC allocation (HashMap entries, String values fromtoString()) and CPU overhead from reflective field access.With R1 (#10522) merged, the
FastCodesHeaderinterface now provideswriteLong/writeInthelpers that can write numeric fields directly withoutString.valueOf()allocation. Implementingencode()/decode()on send message headers eliminates the reflection path entirely.Describe the Solution You'd Like
Implement
encode()anddecode()methods on:SendMessageRequestHeader— 14 fields including Long/Integer typesSendMessageResponseHeader— 5 fieldsSendMessageRequestHeaderV2— fixdecode()signature to match interfaceAdditional Context
Depends on R1 (#10522, merged). Related PRs: #10443, #10514, #10526.