156 lines
9.8 KiB
HTML
156 lines
9.8 KiB
HTML
|
<?xml version="1.0" encoding="UTF-8"?>
|
||
|
<!DOCTYPE html
|
||
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
|
<html lang="en-us" xml:lang="en-us">
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||
|
<meta name="security" content="public" />
|
||
|
<meta name="Robots" content="index,follow" />
|
||
|
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
|
||
|
<meta name="DC.Type" content="reference" />
|
||
|
<meta name="DC.Title" content="Performance improvements" />
|
||
|
<meta name="abstract" content="With the additional classes provided by i5/OS, Java programs running on the Java virtual machine for iSeries 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." />
|
||
|
<meta name="description" content="With the additional classes provided by i5/OS, Java programs running on the Java virtual machine for iSeries 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." />
|
||
|
<meta name="DC.Relation" scheme="URI" content="progtips.htm" />
|
||
|
<meta name="copyright" content="(C) Copyright IBM Corporation 2006" />
|
||
|
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2006" />
|
||
|
<meta name="DC.Format" content="XHTML" />
|
||
|
<meta name="DC.Identifier" content="progtipsperformance" />
|
||
|
<meta name="DC.Language" content="en-us" />
|
||
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
||
|
<!-- US Government Users Restricted Rights -->
|
||
|
<!-- Use, duplication or disclosure restricted by -->
|
||
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
||
|
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
|
||
|
<link rel="stylesheet" type="text/css" href="./ic.css" />
|
||
|
<title>Performance improvements</title>
|
||
|
</head>
|
||
|
<body id="progtipsperformance"><a name="progtipsperformance"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Performance improvements</h1>
|
||
|
<div><p>With the additional classes provided by i5/OS™, Java™ programs running on the Java virtual
|
||
|
machine for iSeries™ 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.</p>
|
||
|
<div class="section"><h4 class="sectiontitle">Shorter download time</h4><p>In order to download the minimum
|
||
|
number of IBM<sup>®</sup> Toolbox
|
||
|
for Java class
|
||
|
files, use the <a href="proxies.htm#proxies">proxy server</a> in combination
|
||
|
with the <a href="jar.htm#jar">AS400ToolboxJarMaker</a> tool.</p>
|
||
|
</div>
|
||
|
<div class="section" id="progtipsperformance__fastercom"><a name="progtipsperformance__fastercom"><!-- --></a><h4 class="sectiontitle">Faster communication</h4><p>For all IBM 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.</p>
|
||
|
<p>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 iSeries instead
|
||
|
of the JDBC driver that comes with the IBM 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 IBM Toolbox
|
||
|
for Java.</p>
|
||
|
</div>
|
||
|
<div class="section"><h4 class="sectiontitle">Directly calling i5/OS APIs</h4><p>Performance of the
|
||
|
following classes of the IBM Toolbox for Java is improved because these classes directly
|
||
|
call i5/OS APIs
|
||
|
instead of calling a server program to carry out the request:</p>
|
||
|
<ul><li>AS400Certificate classes</li>
|
||
|
<li>CommandCall</li>
|
||
|
<li>DataQueue</li>
|
||
|
<li>ProgramCall</li>
|
||
|
<li>Record-level database access classes</li>
|
||
|
<li>ServiceProgramCall</li>
|
||
|
<li>UserSpace</li>
|
||
|
</ul>
|
||
|
<p>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.</p>
|
||
|
</div>
|
||
|
<div class="section" id="progtipsperformance__portmap"><a name="progtipsperformance__portmap"><!-- --></a><h4 class="sectiontitle">Port mapping changes</h4><p>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.</p>
|
||
|
<p>For the port mapping improvement,
|
||
|
a few methods have been added to <a href="as400obj.htm#as400obj">AS400
|
||
|
class</a>:</p>
|
||
|
<ul><li><a href="javadoc/com/ibm/as400/access/AS400.html#GETSERVICEPORT(INT)"> getServicePort</a></li>
|
||
|
<li><a href="javadoc/com/ibm/as400/access/AS400.html#SETSERVICEPORT(INT, INT)"> setServicePort</a></li>
|
||
|
<li><a href="javadoc/com/ibm/as400/access/AS400.html#SETSERVICEPORTSTODEFAULT()"> setServicePortsToDefault</a></li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<div class="section" id="progtipsperformance__messages"><a name="progtipsperformance__messages"><!-- --></a><h4 class="sectiontitle">Language specific strings changes</h4><p>Language-specific
|
||
|
string files are now shipped within the IBM 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 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.</p>
|
||
|
</div>
|
||
|
<div class="section" id="progtipsperformance__converters"><a name="progtipsperformance__converters"><!-- --></a><h4 class="sectiontitle">Converters</h4><p>Two classes allow faster,
|
||
|
more efficient conversion between Java and the iSeries:</p>
|
||
|
<ul><li><a href="javadoc/com/ibm/as400/access/BinaryConverter.html"> Binary Converter</a>: Converts between Java byte
|
||
|
arrays and Java simple types.</li>
|
||
|
<li><a href="javadoc/com/ibm/as400/access/CharConverter.html"> Character Converter</a>: Converts between Java String
|
||
|
objects and i5/OS code
|
||
|
pages.</li>
|
||
|
</ul>
|
||
|
<p>Also, the IBM Toolbox for Java now incorporates its own conversion
|
||
|
tables for over 100 commonly used CCSIDs. Previously, the IBM Toolbox for Java either
|
||
|
deferred to Java for nearly all text conversion. If Java did
|
||
|
not possess the correct conversion table, IBM Toolbox for Java downloaded the conversion table from
|
||
|
the server.</p>
|
||
|
<p>The IBM 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 IBM Toolbox
|
||
|
for Java attempt
|
||
|
to download a conversion table from the server. This technique greatly reduces
|
||
|
the amount of time it takes for an IBM 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.</p>
|
||
|
</div>
|
||
|
<div class="section" id="progtipsperformance__crtjvapgm"><a name="progtipsperformance__crtjvapgm"><!-- --></a><h4 class="sectiontitle">Performance tip regarding the Create Java Program
|
||
|
(CRTJVAPGM) command</h4><p>If your Java application runs on the iSeries Java virtual
|
||
|
machine (JVM), you can <strong>significantly improve performance</strong> if you create
|
||
|
a Java program
|
||
|
from an IBM Toolbox
|
||
|
for Java .zip
|
||
|
file or .jar file. Enter the <strong>CRTJVAPGM</strong> command on an iSeries command
|
||
|
line to create the program. (See the online help information for the <strong>CRTJVAPGM</strong> command
|
||
|
for more information.) By using the <strong>CRTJVAPGM</strong> command, you save the Java program
|
||
|
that is created (and that contains the IBM Toolbox for Java classes) when your Java application
|
||
|
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 application
|
||
|
is started.</p>
|
||
|
<p>If you are using the V4R2 or V4R3 version of IBM Toolbox for Java,
|
||
|
you cannot run the <strong>CRTJVAPGM</strong> command against the jt400.zip or jt400.jar
|
||
|
file because it is too big; however, you may be able to run it against the
|
||
|
jt400Access.zip file. At V4R3, IBM Toolbox for Java licensed program includes an additional
|
||
|
file, jt400Access.zip. jt400Access.zip contains only the access classes, not
|
||
|
the visual classes.</p>
|
||
|
<p>When you run Java applications on a V4R5 (or earlier)
|
||
|
system, use jt400Access.zip. When you run Java applications on a V5R1 system, use
|
||
|
jt400Native.jar. The <strong>CRTJVAPGM</strong> command has already been run against
|
||
|
jt400Native.jar.</p>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div>
|
||
|
<div class="familylinks">
|
||
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="progtips.htm" title="This section features a variety of tips that can help you use IBM Toolbox for Java.">Tips for programming</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|