a044f92c5d212ab37140f330786137447f076f22
Invoke deep-cloned the whole MxCommandRequest — including its command payload, potentially a large bulk-write graph — only to overwrite the cloned command with commandToInvoke and discard it. MapCommand then did the one clone actually needed. Net cost: a full wasted command deep-clone per Invoke, worst for exactly the bulk writes that are largest. Adds a MapCommand(MxCommand) overload (MapCommand reads nothing else off the request) and has Invoke pass commandToInvoke directly; the request overload delegates so other callers are untouched. The remaining clone inside MapCommand stays and is now documented as required rather than incidental: commandToInvoke may be the gRPC-owned request.Command, and the caller reads it again after dispatch via TrackCommandReply, so ownership transfer (à la GWC-07) is not safe here. That clone is what keeps WorkerClient.CreateCommandEnvelope's no-aliasing invariant true. Tests: MxAccessGrpcMapperTests.MapCommandFromCommandClonesPayload (mutating the input leaves the mapped command untouched; both overloads produce equal results under a fixed TimeProvider).
Description
No description provided
Languages
Java
43.9%
C#
43.6%
Python
3.4%
Rust
3.4%
Go
2.9%
Other
2.7%