Performance improvements

With the additional classes provided by OS/400, Java programs running on the Java virtual machine for iSeries 400 experience improved performance. Performance is improved in some cases because less communication function is used, and in other cases, an iSeries API is used instead of calling the server program.

Shorter download time

In order to download the minimum number of AS/400 Toolbox for Java class files, use the proxy server with the AS400ToolboxJarMaker tool.

Faster communication

For all AS/400 Toolbox for Java functions except JDBC and integrated file system access, Java programs running on the Java virtual machine for iSeries will run faster. The programs run faster because less communication code is used when communicating between the Java program and the server program on the server that does the request.

JDBC and integrated file system access were not optimized because facilities already exist that make these functions run faster. When running on the iSeries, you can use the JDBC driver for AS/400 instead of the JDBC driver that comes with the AS/400 Toolbox for Java. To access files on the server, you can use java.io instead of the integrated file system access classes that come with the AS/400 Toolbox for Java.

Directly calling iSeries 400 APIs

Performance of the following classes of the AS/400 Toolbox for Java is improved because these classes directly call iSeries APIs instead of calling a server program to carry out the request:

APIs are directly called only if the user ID and password match the user ID and password of the job running the Java program. To get the performance improvement, the user ID and password must match the user ID and password of the job that starts the Java program. For best results, use "localhost" for system name, "*current" for user ID, and "*current" for password.

Port mapping changes

The port mapping system has been changed, which makes accessing a port faster. Before this change, a request for a port would be sent to the port mapper. From there, the iSeries server would determine which port was available and return that port to the user to be accepted. Now, you can either tell the server which port to use or specify that the default ports be used. This option eliminates the wasted time of the server determining the port for you. Use the WRKSRVTBLE command to view or change the list of ports for the server.

For the port mapping improvement, a few methods have been added to AS/400 class:

MRI changes

MRI files are now shipped within the AS/400 Toolbox for Java program as class files instead of property files. The iSeries server finds messages in class files faster than in property files. ResourceBundle.getString() now runs faster because the MRI files are stored in the first place that the computer searches. Another advantage of changing to class files is that the server can find the translated version of a string faster.

Converters

Two classes allow faster, more efficient conversion between Java and the AS/400:

Begin changeAlso, the AS/400 Toolbox for Java now incorporates its own conversion tables for over 100 commonly used CCSIDs. Previously, the AS/400 Toolbox for Java either deferred to Java for nearly all text conversion. If Java did not possess the correct conversion table, AS/400 Toolbox for Java downloaded the conversion table from the server.

The AS/400 Toolbox for Java performs all text conversion for any CCSID of which it is aware. When it encounters an unknown CCSID, it attempts to let Java handle the conversion. At no point does the AS/400 Toolbox for Java attempt to download a conversion table from the server. This technique greatly reduces the amount of time it takes for an AS/400 Toolbox for Java application to perform text conversion. No action is required by the user to take advantage of this new text conversion; the performance gains all occur in the underlying converter tables.End change

Performance tip regarding the Create Java Program (CRTJVAPGM) command

If your Java program runs on the Java virtual machine of the iSeries server, you can significantly improve performance if you create a Java program from AS/400 Toolbox for Java zip file or jar file. Enter the CRTJVAPGM command on an iSeries command line to create the program. (See the online help information for the CRTJVAPGM command for more information.) By using the CRTJVAPGM command, you save the Java program that is created (and that contains the AS/400 Toolbox for Java classes) when your Java program starts. Saving the Java program that is created allows you to save startup processing time. You save startup processing time because the Java program on the server does not have to be re-created each time your Java program is started.

If you are using the V4R2 or V4R3 version of AS/400 Toolbox for Java, you cannot run the CRTJVAPGM command against the jt400.zip or jt400.jar file because it is too big; however, you may be able to run it against the jt400Acces.zip file. At V4R3, AS/400 Toolbox for Java licensed program includes an additional file, jt400Access.zip. jt400Access.zip contains only the access classes, not the visual classes. If your Java program is running on AS/400, you should use jt400Access.zip, because you probably only need the access classes. The CRTJVAPGM command has already been run against jt400Access.zip.