Batching I

One form of batching optimization is to combine multiple messages into one message. For the examples we’ve examined so far, this is easily illustrated. Simply add a method to access all attributes of the server object in one access:[83]

class ServerObjectDataCopy
{
  public boolean bool;
  public int number;
  public String string;
}

public class ServerObjectImpl
{
  public ServerObjectDataCopy getAll( );
  ...

Using this method to batch the three access methods into one access makes the combined (uncached) access of all the attributes three times faster.

[83] The various communication layers handle distributed classes differently. This book is not a tutorial on CORBA or RMI, so I have elected to show a standard Java representation of the required classes.

Get Java Performance Tuning now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.