Why is Applet Slower than Application?

Discussion in 'Java' started by Sanny, Feb 28, 2008.

  1. Sanny

    Sanny Guest

    After lot of reading I found, JVM takes control of the Applet and
    Browser has nothing to do with the Applet.

    But then I have a few Question.

    Say I have a System with 2 GB RAM. Will I be able to Create an Array
    of Integer with Large Memory Size taking upto 2 GB RAM? Or the Browser
    will not allow Large Arrays?

    int[][][] BigArray = new int[1000][1000][1000]; Will such big array be
    allowed on an Applet?

    Can I get the information about RAM on a System and initialize arrays
    depending on the Maximum Memory the Desktop has?

    Can I know in an applet whether the System is Dual Procesor or Quad
    Processor or a 8 core Processor is there any code in Applet to know
    about Hardware Configurations of the system it is running on?

    Why do Applet so much limited in functionality?

    I see Flash are so Fast. If you design an Animation in Flash it loads
    in 1 second and Runs so smoothly. While Java Applet Blurs so much????

    Why can't .Sun develop Applet which work as good as Flash? Both uses
    plugin then why Java plugin so bad?

    Can these slowness and restrictions be removed from Applets easily???

    Can I give a Button In an Applet which asks for user Confirmation to
    speedup the Applet and once the user Confirms the Applet runs as an
    Application taking all resources from the Computer?

    Bye
    Sanny
     
    Sanny, Feb 28, 2008
    #1
    1. Advertising

  2. Sanny

    Sanny Guest

    I heard c is very fast than Applet.

    Can I make a Function in C language and Call through an Applet And
    then return the resut to the Applet. So the GUI will be applet based
    and Processing of Functions will be done in C or C#? Is it feasible to
    do such a thing?

    Activex are designed in C language so Are Activex faster than Applets?
    I f I create an ActiveX and ask the Applet to get result from ActiveX
    can that be possible?

    Or I just ask the user to download a c.exe and Applet calls that
    program to get results from functions? So that it gets full processing
    speed of C language.

    Bye
    Sanny
     
    Sanny, Feb 28, 2008
    #2
    1. Advertising

  3. Sanny

    Nigel Wade Guest

    Sanny wrote:

    > I heard c is very fast than Applet.


    Who from?

    >
    > Can I make a Function in C language and Call through an Applet And
    > then return the resut to the Applet. So the GUI will be applet based
    > and Processing of Functions will be done in C or C#? Is it feasible to
    > do such a thing?


    Feasible, I suppose so. But your applet will need to be signed, you would need
    to provide the user with the C code and the means to install it, and the user
    will be required to relinquish all the protections which the applet sandbox
    provides them with.

    >
    > Activex are designed in C language so Are Activex faster than Applets?


    Faster at what?

    > I f I create an ActiveX and ask the Applet to get result from ActiveX
    > can that be possible?


    Why would you want to? ActiveX is restricted to Internet Explorer on Windows.
    The entire point of using applets is that they are cross platform. If you are
    going to make certain that your applet will only run on Windows/IE why bother
    using a Java applet at all?

    >
    > Or I just ask the user to download a c.exe and Applet calls that
    > program to get results from functions? So that it gets full processing
    > speed of C language.


    Even less reason to use an applet. If the user has to download, install and run
    your c.exe, why would you (or they) want to have an applet as well?

    --
    Nigel Wade, System Administrator, Space Plasma Physics Group,
    University of Leicester, Leicester, LE1 7RH, UK
    E-mail :
    Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
     
    Nigel Wade, Feb 28, 2008
    #3
  4. Sanny wrote:
    > Say I have a System with 2 GB RAM. Will I be able to Create an Array
    > of Integer with Large Memory Size taking upto 2 GB RAM? Or the Browser
    > will not allow Large Arrays?


    1. Capitalization of Words Is not a Random choice. Only the first word
    of a sentence and proper nouns should be capitalized. Acronyms and code
    have different semantics, though.

    > int[][][] BigArray = new int[1000][1000][1000]; Will such big array be
    > allowed on an Applet?


    2. Do you have 4GB of main+virtual memory handy? I believe that Windows,
    as most consumers have it, does not allow a process to take more than 4
    GB of virtual memory. This is not a limitation limited by Java, or by
    the applet model, but by the OS and system configuration.

    3. Why do you need so much memory?

    > Can I get the information about RAM on a System and initialize arrays
    > depending on the Maximum Memory the Desktop has?


    4. No.

    5. Why would you want to do this? The only thing I can think of is for
    monitoring cache resources, and this is not a method I would use to
    dictate cache.

    6. Java 5 (IIRC) and 6 both allow one to declare monitoring of memory by
    the running process.

    > Can I know in an applet whether the System is Dual Procesor or Quad
    > Processor or a 8 core Processor is there any code in Applet to know
    > about Hardware Configurations of the system it is running on?


    7. No. You can set up normal multithreaded systems, though.

    8. Again, what information would you want to find out that matters
    greatly to the running of your program?

    > Why do Applet so much limited in functionality?


    9. Because you didn't explicitly install the code. For example, you
    don't want some website's applet surreptitiously starting up and reading
    /etc/passwd (for *nix systems) back to its home site, or copying the
    contents of your My Documents folder (for Windows systems). You can make
    applets trusted, which requires the user to explicitly authorize access
    to you via a dialog.

    > I see Flash are so Fast. If you design an Animation in Flash it loads
    > in 1 second and Runs so smoothly. While Java Applet Blurs so much????


    10. One question mark is enough. While on that subject, I would like to
    point out the issue of haphazard capitalization again.

    11. Flash is optimized for animations, whereas Java is not. There is
    also the issue of Java VM start times.

    > Why can't .Sun develop Applet which work as good as Flash? Both uses
    > plugin then why Java plugin so bad?


    12. It's `Sun', not `.Sun'.

    13. I think applets work better than Flash in many cases.

    14. The issue is not that they're plugins, but the design of the code.
    I've never looked heavily into how Flash works, but IIRC, a Flash
    application with as much design logic as the typical Java applet will
    run into similar problems.

    > Can these slowness and restrictions be removed from Applets easily???


    15. Preload the Java VM to ease slowness.

    16. Create trusted applets to remove security restrictions, and hope
    that the users grant you these permissions.

    > Can I give a Button In an Applet which asks for user Confirmation to
    > speedup the Applet and once the user Confirms the Applet runs as an
    > Application taking all resources from the Computer?


    17. An application that takes all my RAM, CPU usage, and HD space? Just
    what ARE you doing that needs to use so many resources?

    18. See above answers for me details.

    Final nit:
    19. Take a small amount of time to edit for proper capitalization,
    grammar, and punctuation. Large amounts of improper usages are very
    distracting and difficult to read.

    --
    Beware of bugs in the above code; I have only proved it correct, not
    tried it. -- Donald E. Knuth
     
    Joshua Cranmer, Feb 28, 2008
    #4
  5. Sanny

    Arne Vajhøj Guest

    Sanny wrote:
    > Say I have a System with 2 GB RAM. Will I be able to Create an Array
    > of Integer with Large Memory Size taking upto 2 GB RAM? Or the Browser
    > will not allow Large Arrays?
    >
    > int[][][] BigArray = new int[1000][1000][1000]; Will such big array be
    > allowed on an Applet?


    Actually the amount of physical memory only determines the
    performance.

    Whether you can have such a big array depends on the virtual memory.

    32 bit OS : no
    64 bit OS : yes

    > Can I get the information about RAM on a System and initialize arrays
    > depending on the Maximum Memory the Desktop has?


    No. But you can get the maximum heap size Java can get.

    See Runtime.maxMemory().

    > Can I know in an applet whether the System is Dual Procesor or Quad
    > Processor or a 8 core Processor is there any code in Applet to know
    > about Hardware Configurations of the system it is running on?


    No.

    > Why do Applet so much limited in functionality?


    For security reasons.

    > I see Flash are so Fast. If you design an Animation in Flash it loads
    > in 1 second and Runs so smoothly. While Java Applet Blurs so much????


    I think that depends a lot on the Java programmer.

    > Why can't .Sun develop Applet which work as good as Flash? Both uses
    > plugin then why Java plugin so bad?


    If you like Flash then use Flash.

    > Can I give a Button In an Applet which asks for user Confirmation to
    > speedup the Applet and once the user Confirms the Applet runs as an
    > Application taking all resources from the Computer?


    That is not how preemptive multitasking OS'es work.

    Arne
     
    Arne Vajhøj, Feb 29, 2008
    #5
  6. Sanny

    Arne Vajhøj Guest

    Sanny wrote:
    > I heard c is very fast than Applet.


    It can be.

    > Can I make a Function in C language and Call through an Applet And
    > then return the resut to the Applet. So the GUI will be applet based
    > and Processing of Functions will be done in C or C#? Is it feasible to
    > do such a thing?


    No.

    > Activex are designed in C language so Are Activex faster than Applets?
    > I f I create an ActiveX and ask the Applet to get result from ActiveX
    > can that be possible?


    I would not expect users to allow ActiveX modules to run.

    > Or I just ask the user to download a c.exe and Applet calls that
    > program to get results from functions? So that it gets full processing
    > speed of C language.


    Applet security will not allow that.

    Arne
     
    Arne Vajhøj, Feb 29, 2008
    #6
  7. Sanny

    Roedy Green Guest

    On Thu, 28 Feb 2008 00:04:06 -0800 (PST), Sanny
    <> wrote, quoted or indirectly quoted someone who
    said :

    >Say I have a System with 2 GB RAM. Will I be able to Create an Array
    >of Integer with Large Memory Size taking upto 2 GB RAM? Or the Browser
    >will not allow Large Arrays?


    The browser itself eats ram you could potentially use with a
    application instead of an Applet. You can configure heap size etc, on
    the Java.exe command line. I don't know how you could do the same in
    an Applet. You have to take what the browser author thought was
    appropriate.
    --

    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
     
    Roedy Green, Feb 29, 2008
    #7
  8. Sanny

    Arne Vajhøj Guest

    Joshua Cranmer wrote:
    > 2. Do you have 4GB of main+virtual memory handy? I believe that Windows,
    > as most consumers have it, does not allow a process to take more than 4
    > GB of virtual memory.


    32 bit Windows : only somewhere around 1.6-1.7

    64 bit Windows : plenty

    Arne
     
    Arne Vajhøj, Feb 29, 2008
    #8
  9. Sanny

    Roedy Green Guest

    On Thu, 28 Feb 2008 00:12:13 -0800 (PST), Sanny
    <> wrote, quoted or indirectly quoted someone who
    said :

    >Can I make a Function in C language and Call through an Applet And
    >then return the resut to the Applet. So the GUI will be applet based
    >and Processing of Functions will be done in C or C#? Is it feasible to
    >do such a thing?


    In theory yes, but the problem is getting the DLL installed on the
    client machine in a place the Applet can find it. The Applet must be
    signed. It is MUCH easier to use Java Web Start. I tried to
    implement SetClock as an Applet and gave up. It is now does with JWS.

    See http://mindprod.com/jgloss/javawebstart.html
    http://mindprod.com/jgloss/applet.html
    --

    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
     
    Roedy Green, Feb 29, 2008
    #9
    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. abilash
    Replies:
    1
    Views:
    583
    Jim Lewis
    May 17, 2005
  2. Andre Charbonneau

    XPath queries getting slower and slower...

    Andre Charbonneau, Feb 15, 2005, in forum: Java
    Replies:
    0
    Views:
    557
    Andre Charbonneau
    Feb 15, 2005
  3. Mark
    Replies:
    20
    Views:
    1,677
    Dave O'Hearn
    Dec 27, 2004
  4. Maurice LING

    why python is slower than java?

    Maurice LING, Nov 5, 2004, in forum: Python
    Replies:
    113
    Views:
    2,462
  5. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,076
    Smokey Grindel
    Dec 2, 2006
Loading...

Share This Page