-
Enhancement
-
Resolution: Done
-
Major
-
None
-
None
When invoking RPCs, RpcDispatcher converts the MethodCall used into a byte array and passes that to a BytesMessage that's then sent down to the transport.
This is inefficient, as an unneeded byte array allocation is done, both when an RPC request is sent and when the response is sent.
Instead of doing eager marshalling of MethodCall into a byte array, pass the MethodCall to an ObjectMessage, which marshalls the latter directly to the output stream of the transport at send time.
This eliminates 2 memory allocations per RPC round-trip (on a sync RPC).