Is a Java Application much faster than an Applet.

Discussion in 'Java' started by Sanny, Dec 10, 2006.

  1. Sanny

    Sanny Guest

    I have an Applet which works slow, I think as Browser JVM may be slow.
    If I convert it into Java Application will it be much faster just as
    Application developed in C++ etc.

    Thanks
    Sanjay
     
    Sanny, Dec 10, 2006
    #1
    1. Advertisements

  2. Browser (make and model), VM (make and version)
    It is probably the code of the applet that is slow,
    what does it do?
    ( Please add '?' to the end of questions )

    Probably not, but it is easy enough to test for any
    applet that does not require a complete applet context
    (create a frame, create an instance of the applet,
    add the applet to the frame, then call init() and
    start on the applet instance).

    Andrew T.
     
    Andrew Thompson, Dec 10, 2006
    #2
    1. Advertisements

  3. ...given you can launch applets by themselves in a free
    floating frame that has its own VM, using web-start.
    E.G. <http://www.physci.org/pc/jtest-applet.jnlp>

    Andrew T.
     
    Andrew Thompson, Dec 10, 2006
    #3
  4. If the browser and standalone app will use the same
    Java version, then I can not see any reason for a
    big speed difference.

    Arne
     
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=, Dec 10, 2006
    #4
  5. Sanny

    Sanny Guest

    I want to speedup my Applet in any way I have three Choices which one
    should I choose and which will really help.

    1. Convert Applet to a Frame Window.
    2. Create a Java Application to run the program instead of Applet
    3. Convert this Applet into .exe file using C++/Delphi


    Which will be the best way to get fast output.


    Bye
    Sanny
     
    Sanny, Dec 11, 2006
    #5
  6. Sanny

    Ian Wilson Guest

    4. Find out why your applet is slow.
     
    Ian Wilson, Dec 11, 2006
    #6
  7. Sanny

    Mark Rafn Guest

    Why are these your only choices? Do you think they're equal in the amount of
    work involved?

    Add to your list
    0. Figure out what part of the applet is slow and why.

    0.5. Fix the applet.
    Usually pretty easy. Unlikely to help very much.
    How is this different from #1?
    This is a complete rewrite. If you're going to do that, why not actually
    profile your applet, figure out what's wrong, and fix that (option 0).
    As others have said, it depends on your application.
     
    Mark Rafn, Dec 11, 2006
    #7
  8.  
    lakkireddy.lakshmi, Dec 12, 2006
    #8
  9. Sanny

    EJP Guest

    Why would there be any difference at all? maybe apart from startup time.
     
    EJP, Dec 13, 2006
    #9
  10. It might and it might not, but some browsers will share
    a JVM instance across pages, &/or sites, whereas others
    might dedicate a JVM to each appelt.

    Would you expect your applet to work at the same speed if
    it were in a VM that was also running two other applets, one
    of which was doing repaints every 10 msec, while the other
    was doing constant calls to JS via LiveScript?

    Andrew T.
     
    Andrew Thompson, Dec 13, 2006
    #10
  11. Sanny

    Daniel Pitts Guest

    Even if that were the case, I'm not sure that would affect overal
    speed, an Applet running in that VM may run faster than another applet
    due to thread scheduling. It depends greatly on the VM implementation,
    Browser implementation, and OS cpu scheduling implementation.

    A good test to see if its the browser specifically, or the applet
    itself is to use appletviewer.

    Although, I'd be inclined to run a profiler and see exactly where the
    time is consumed.
     
    Daniel Pitts, Dec 14, 2006
    #11
  12. What are you comparing ?

    If it is:

    1 PC with 1 app JVM doing X and 1 browser JVM doing Y and Z

    versus

    1 PC with 1 browser JVM doing X, Y and Z

    then that should also be rather close.

    Unless the JVM implementation is very bad, then the performance
    should depend on what is being done (X, Y and Z) - not how
    they are distributed among JVM's and whether the JVM i run
    by a browser or standalone.

    Arne
     
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=, Dec 15, 2006
    #12
  13. 3rd scenario:
    1 PC with 1 browser using 1 VM for *3* pages
    all doing X, Y and Z.

    I was effectively comparing the second & third scenarios.

    Andrew T.
     
    Andrew Thompson, Dec 15, 2006
    #13
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.