Applet load process is too slow!
I make a jar file X for my applet X.It contains 27 classes.
And a jar file Y for my applet Y.It cantains 8 classes.
The two applets do similar things.
After I put them on to the internet, I found that it's took 3 seconds to load applet Y, but 20 seconds to load applet X.
How can i speed up the loading process of applet X?
(I use IE browser.)
[382 byte] By [
cheri.shua] at [2007-9-29 20:06:51]

It's all about 2 things:1) Size of the Jars: bigger jars take longer to load2) What the applet has to do: the more the applet does at initialization to built itself, the longer it takes.So what's the Jar sizes and what's the applets doing?
hi bsampieri,
the applet jar file size is only 40KB, and i add some log code into my applet(the output as follows):
03:43:11: begin init()
03:43:12: end init()
03:43:12: begin start()
03:43:12: end start()
03:43:12: begin first paint()
03:43:12: end first paint()
it shows that all init actions only take 2 seconds, but the loading process takes 20 seconds.
so what it is doing during the left 18 seconds?
p.s. when i open my applet on localhost(127.0.0.1/192.168.0.38), it load very fast(<1 secs);but when i open my applet on other machine(192.168.0.16 etc.), it load very slowly(>15 secs).
But are those init/start/paint prints being done at the end of the 20 seconds or the begining? If at the begining, then I don't no what the problem could be except something you are doing in the applet that's taking a lot of time. At the end, then part of it is the JVM has to load, then it needs to load the jar and get the classes out of it. I'm not sure it should take that long, though.
I have a fairly complex applet in my current project and it doesn't usually take more then 10 seconds, if that. It doesn't seem to matter if it's from localhost or some other server. But 40KB isn't much.
what's the speed of your network?
Are you using a different browser on the other machine (IE on one, Mozzilla or Netscape on the other)?
Different JVM maybe? Even OS can make a difference in Java performance, Linux is a lot slower than Windows usually for example.
Is the other computer accessing your server through a firewall or proxy? If so that one could be taking its sweet time determining whether the request is valid or not and trying to find the jar in its cache when it is.