Manik Surtani wrote:
On 31 Mar 2009, at 11:16, Mircea Markus wrote:
Hi,
Some thought on ReplicateCommand.
It is also used to replicate a single command, which is inefficient, as 2 objects are unnecessarily created: the ReplicateCommand itself and an array holding only one object.
Why not replicated the aggregated command directly?
The actual command is replicated directly. See ReplicateCommand.getParameters(). There is just an extra int in the byte stream containing the number of commands contained.
There still are two built objects being built, ReplicateCommand and the aggregated ReplicableCommand[], that's my concern.
Re:getParameters, I see that there is an array built in that command, which contains the param list. what about creating an array pool, and pass them to the command, i.e. the signature would be: getParameters(Object[] params)?