Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Aug 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Java Applet slow loading

    I included a small applet in a web page. It calls for 3 *.class files, each between 5 and 10K.
    First time the applet is loading, there is a wait time of almost 30 seconds. Then, when coming back to it from another page, the loading time is "normal (5 to 10 seconds).
    Is there a way to prevent this first latency? Like preloading the applet?
    Thanks

  2. #2
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Java Applet slow loading

    I'm sure other loungers may have different things to say about this...

    My explanation for the first-time delay is not related to download time. It's actually related to the need for your Operating System to load the Java Virtual Machine (software to emulate a java environment), required to run Java Applets. Of course, any file will take slightly longer the first time you download it, but less than 30K of Class files wouldn't cause that much of a delay. In my mind, the JVM is an aweful resource hog - especially on older systems... Although, I have never actually tested its true performance. Once it's been loaded, any other Java Applets will display much faster.

    There are several different Java Virtual Machines out there - Microsoft and of course, Sun. The extra overhead of the JVM is the big reason that most developers choose Flash over Java applets for most things today. I think it's a shame that Microsoft makes it so easy for FrontPage users to create pages with awefully inefficient Java applets used as navigation buttons. (It's MUCH more efficient to use a simple JavaScript MouseOver with GIF graphics.)

    If you are using these Applets for Navigation buttons, I would recommend that you reconsider. I will be happy to direct you to some resources that will help you create a MouseOver GIF instead.

    Just my 2 Cents <img src=/S/2cents.gif border=0 alt=2cents width=15 height=15>

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Java Applet slow loading

    I agree it's the time to load the JVM or Microsoft VM. I don't think there's anything you can do about this for others who visit your site, but you probably could pre-load it on your own machine if you visit a lot of sites that use Java. I guess you could post a note to the user...

    Afterthought: The reason I don't think you can pre-load for other users is that the browser doesn't respond to mouse clicks or other input while the VM is loading. Unless you can find a way to load the VM in a completely separate thread...

  4. #4
    New Lounger
    Join Date
    Aug 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Java Applet slow loading

    Thanks for the responses.
    As I am working with a Pano applet with "special" features, I am a bit "stuck" with this applet. I thought there must be a way to preload the JVM, even on a "dummy" page so that the end-user would not be aware of this latency time. Then when he would go to the panorama page, it would load much faster. From what I read here, do you mean that I can load ANY Java Applet to load the JVM, thus shortening the loading time of "my" applet?
    Thanks again,

  5. #5
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Java Applet slow loading

    > do you mean that I can load ANY Java Applet to load the JVM, thus shortening the loading time of "my" applet?

    Yes, but it might not save much time.

    Based on a not-very-well-controlled test yesterday, I might be wrong about the whole browser being busy when you load an applet. Thus, you might be able to pop a minimized window behind your main window to trigger the pre-loading while the user interacts with the front window. Worth a test.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •