Reduce applet download time

I have an html file with a jar file that is included as an applet in it. When I open the html file, you get too much time to download the applet.

Is there a way to reduce boot time?

+6
java html jar applet
source share
3 answers

There are three main factors.

1) Java startup time. A cold start was usually 5-10 seconds, however this changed from Java quickstarter , which was part of Java 1.6 Update 10. This is enabled by default for Windoes XP and 2000 (Vista offers its own pre-load mechanisms), but maybe you have it is disabled ( enable information ).

2) Download time for your applet. Check it locally, and if the startup time is significantly different, consider using the best compression methods. Proguard will obfuscate code and reduce code size by up to 90 percent . 90Kb should not be slow, but it may depend on the speed of your network and host.

3) The code you use to initialize the applet. You can temporarily change your init method to just show the hello world button to determine if this is a problem. If you're not comfortable with performance, you might need a profile of your code.

The applet launch time should be about a second (excluding download time). Make sure you have fairly recent Java and try the simple Hello World applet .

+3
source share

You can use Pack 200 to minimize the size of the JAR file. Who cares, it will depend on how much time is spent downloading and how much it costs to start after loading.

+1
source share

If the startup time is too slow, even if it is loaded locally, the only thing you can do is switch to HTML5, Flash, or Silverlight. I know this is a little trolling, but the JVM / sandbox implementation is to blame, and there is nothing you can do about it.

The SUN guys really didn't get the RIA-s requirements. Of course, it is always possible that Oracle will speed up the process, but applets are already 15 years old and have been slow since then.

-2
source share

All Articles