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. Advertising

  2. Sanny wrote:
    > I have an Applet


    URL?

    >.. which works slow, I think as Browser JVM


    Browser (make and model), VM (make and version)

    >..may be slow.


    It is probably the code of the applet that is slow,
    what does it do?

    > If I convert it into Java Application will it be much faster just as
    > Application developed in C++ etc.


    ( 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. Advertising

  3. Andrew Thompson wrote:
    > Sanny wrote:
    > > I have an Applet ...

    ...
    > > If I convert it into Java Application will it be much faster ..

    ...
    > Probably not, but it is easy enough to test for any
    > applet ...


    ...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. Sanny wrote:
    > 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.


    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


    > If the browser and standalone app will use the same
    > Java version, then I can not see any reason for a
    > big speed difference.


    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

    Sanny wrote:
    >>If the browser and standalone app will use the same
    >>Java version, then I can not see any reason for a
    >>big speed difference.

    >
    >
    > 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.
    >


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

    Mark Rafn Guest

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


    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.

    >1. Convert Applet to a Frame Window.


    Usually pretty easy. Unlikely to help very much.

    >2. Create a Java Application to run the program instead of Applet


    How is this different from #1?

    >3. Convert this Applet into .exe file using C++/Delphi


    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).

    >Which will be the best way to get fast output.


    As others have said, it depends on your application.
    --
    Mark Rafn <http://www.dagon.net/>
     
    Mark Rafn, Dec 11, 2006
    #7
  8. Sanny

    Guest

    On Dec 10, 9:42 pm, Arne Vajhøj <> wrote:
    > Sanny wrote:
    > > 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.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
     
    , Dec 12, 2006
    #8
  9. Sanny

    EJP Guest

    Sanny wrote:
    > 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


    Why would there be any difference at all? maybe apart from startup time.
     
    EJP, Dec 13, 2006
    #9
  10. EJP wrote:
    > Sanny wrote:
    > > 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

    >
    > Why would there be any difference at all? maybe apart from startup time.


    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

    Andrew Thompson wrote:
    > EJP wrote:
    > > Sanny wrote:
    > > > 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

    > >
    > > Why would there be any difference at all? maybe apart from startup time.

    >
    > 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.


    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. Andrew Thompson wrote:
    > 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?


    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. Arne Vajhøj wrote:
    > Andrew Thompson wrote:
    > > 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?

    >
    > 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


    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. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stef Mientki

    Wow, Python much faster than MatLab

    Stef Mientki, Dec 29, 2006, in forum: Python
    Replies:
    11
    Views:
    664
    sturlamolden
    Jan 1, 2007
  2. Doran, Harold

    RE: Wow, Python much faster than MatLab

    Doran, Harold, Dec 30, 2006, in forum: Python
    Replies:
    10
    Views:
    1,118
    Wensui Liu
    Jan 1, 2007
  3. kwatch
    Replies:
    1
    Views:
    349
    Igor Katson
    Jun 17, 2009
  4. kwatch
    Replies:
    0
    Views:
    284
    kwatch
    Jun 14, 2009
  5. Melzzzzz
    Replies:
    39
    Views:
    1,892
    Melzzzzz
    Jul 29, 2012
Loading...

Share This Page