1. A method of dispatching multiple Java Native Interface calls comprising: identifying a sequence of Java Native Interface calls to be made by native code; determining if the sequence of Java Native Interface calls includes overhead for creating a local reference of an intermediate object and subsequent removal of that local reference; omitting Java Native Interface calls that include overhead for creating the local reference of an intermediate object and subsequent removal of that local reference from the sequence; encapsulating the sequence of Java Native Interface calls into a batch; and wherein each call of the batch is encapsulated by iteratively performing for each call to be made: identifying the Java Native Interface function to call; identifying the arguments to pass into the Java Native Interface function; dispatching to the Java Native Interface function; and capturing the return value.