Is a Java Application much faster than an Applet.

S

Sanny

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
 
A

Andrew Thompson

Sanny said:
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.
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

Sanny said:
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
 
S

Sanny

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
 
I

Ian Wilson

Sanny said:
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.
 
M

Mark Rafn

Sanny said:
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.
 
E

EJP

Sanny said:
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.
 
A

Andrew Thompson

EJP said:
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.
 
D

Daniel Pitts

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

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

Andrew said:
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
 
A

Andrew Thompson

Arne said:
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.
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,573
Members
45,046
Latest member
Gavizuho

Latest Threads

Top