Applets are slow!
You've probably heard someone say this — or perhaps you've said it yourself in a moment of frustration. However, applets need not be slow. The purpose of this paper is to describe how to turbocharge your applet experience.
Java applet based solutions can provide a very rich user experience delivered in a Web browser interface. However, especially in slow network environments with dial-up connected clients, applet download performance issues can severely limit their effectiveness. In order to execute on a Web client machine, an applet's implementation files and all required class libraries must be downloaded from the Web server host to the client machine. Although the applet implementation files are typically quite small, the class libraries required to support the applet functionality can be very large in size. As a result, downloading these class libraries can be very time consuming in a slow network environment such as a dial-up connection.
The obvious solution to this problem is to pre-install the class libraries onto the client machines. However, doing so via manual installation of the class libraries is not a good option since it is an error prone approach that can also prove to be prohibitively costly to administer. This is especially true where there are many client machines in widely spread out locations. Moreover, these same cost issues arise anew whenever the class libraries need to be updated for any reason.
To help overcome these problems, the SAS AppDev Studio product suite includes JSASNetCopy, a transparent, zero-install solution. Using this technology, the applet's required class libraries can be downloaded automatically the first time that the applet HTML is referenced and then cached on the client machine for subsequent re-use. No separate install program needs to be run prior to invoking the applet HTML and no manual configuration is required by the end-user. Additionally, updated class libraries can be made available simply by installing them on the Web server and modifying a server-side configuration file. Then, the next time a user access the applet HTML, the updated class libraries will be automatically downloaded and cached on the client machine.
The remainder of this document describes how to use JSASNetCopy to improve applet initialization performance. Finally, additional techniques for boosting applet performance are listed with references to related documentation.
Note that prior versions of AppDev Studio included an alternate solution, SASNetCopy, which is no longer supported. The SASNetCopy solution relied on a custom ActiveX control when running in Internet Explorer and Netscape's SmartUpdate feature when running in Netscape. Netscape no longer supports SmartUpdate. Additionally, the JSASNetCopy solution now provides more functionality without relying on native code.
The purpose of JSASNetCopy is to perform a transparent auto-install of any supporting class libraries required by an applet onto a client system when the applet's HTML is accessed. JSASNetCopy is a pure Java implementation that leverages facilities provided by Sun's Java Plug-in. When invoked by the applet HTML, JSASNetCopy retrieves a list of needed libraries from the Web server and, if necessary and if the user approves, installs those libraries on the client machine. JSASNetCopy then launches the applet. Once the supporting libraries have been installed once, they persist on the system such that the dependent applet and any other applets that require them will start up virtually instantaneously on subsequent executions.
JSASNetCopy is a combination of a proxy applet, an optional package
for the Java Virtual Machine, and configuration files which list libraries needed by most applets. The applet HTML is altered to run the JSASNetCopy applet and information necessary to run the original applet is placed in the JSASNetCopy applet's <param>
tags. The JSASNetCopy applet triggers the download and installation of the main
JSASNetCopy code. The JSASNetCopy applet then uses the installed JSASNetCopy code to
install any required libraries as listed in the configuration files. Once the
installation is complete, the JSASNetCopy applet replaces itself with the desired applet
and applet execution continues as usual.
For information on how to deploy applets when using JSASNetCopy, see Deploying with JSASNetCopy. See the JSASNetCopy Detailed Description for in-depth information on how JSASNetCopy works. To learn how to configure JSASNetCopy, see the JSASNetCopy Administration document.
By auto-installing Java class libraries onto client systems, JSASNetCopy provides a significant benefit to applet performance. However, using JSASNetCopy is only the first step towards improving applet startup time. Additional steps such as the following should be considered given the particular circumstances:
AppDev Studio provides a number of techniques that you can use to solve applet performance problems. Where applet download times are a problem, JSASNetCopy along with the Java Plug-in's applet caching feature can be used to install the applet classes and any required extension classes onto the client machine. All of these technologies use a zero-administration, auto-install approach. Where SAS startup time is an issue, the AppDev Studio Middleware Server's SAS session preloading and MDDB or class preloading features can be used such that the required SAS support is available to a client virtually instantaneously. By analyzing your particular situation and applying these technologies as outlined in this and related documents, it should be possible to significantly speed up applet startup times.