>> How does Java run on WebPages if it is not interpreted?
>
[quoted text clipped - 15 lines]
>
> Arne
How long does this whole process take? Does the user have to
wait a long time for a Java applet to be compiled before it
runs? I need a language that will run will very little
delay, either directly from source-code or very quickly
compiled.
Daniel Pitts - 24 Oct 2007 04:57 GMT
>>> How does Java run on WebPages if it is not interpreted?
>> JSP (Java Server Pages) is triple compiled on the server
[quoted text clipped - 20 lines]
> delay, either directly from source-code or very quickly
> compiled.
The Applet is compiled to byte code by the developer, so that doesn't
affect the user startup time. The JIT compiler is designed to be
somewhat transparent to the application user while increasing speed for
the user.

Signature
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
Owen Jacobson - 24 Oct 2007 05:19 GMT
> "Arne Vajh?j" <a...@vajhoej.dk> wrote in message
>
[quoted text clipped - 25 lines]
> delay, either directly from source-code or very quickly
> compiled.
The compilation from bytecode to native code is an ongoing, background
process performed on code as it's run and profiled by the JVM. Sun's
implementation ("Hotspot") is described in detail on their site:
<http://java.sun.com/javase/technologies/hotspot/index.jsp>
In general JIT compilation trades a small slowdown initially (overhead
of running a lightweight profiler and the compilation process itself)
for a relatively large speedup over the life of the program. I've
seen test cases for some things double in speed over a few minutes of
repeated tests, personally (for somewhat CPU-heavy operations: XML
parsing from a memory buffer).
You'll need to quantify your speed needs and measure for yourself
whether a given language is "fast enough", but personally I've found
Java to be more than fast enough for the vast majority of programs.
YMMV,
Owen
RedGrittyBrick - 24 Oct 2007 11:22 GMT
> How long does this whole process take? Does the user have to
> wait a long time for a Java applet to be compiled before it
> runs? I need a language that will run will very little
> delay, either directly from source-code or very quickly
> compiled.
Will your application (SeeScreen?) be generating Java source code, then
(compiling and) executing it?
On a PC with a 1.7 GHz Celeron and 512MB RAM, running Windows XP Pro,
with many other applications open, it took about three seconds to
execute `javac HelloWorld.java`, it took about four seconds to compile a
150 line Java class.
Dirk Michaelsen - 24 Oct 2007 15:39 GMT
>On a PC with a 1.7 GHz Celeron and 512MB RAM, running Windows XP Pro,
>with many other applications open, it took about three seconds to
>execute `javac HelloWorld.java`, it took about four seconds to compile a
> 150 line Java class.
don't forget that before javac starts compiling any code, it has to
load and setup it's environment. Once loaded it doesn't make a huge
difference wether you compile 1 or 10 files, 150 or 10000 lines of
code. You can see this significantly clear if you use a build utility
like ant wich bulk compiles a whole application in a few seconds.
Dirk
Arne Vajhøj - 24 Oct 2007 13:15 GMT
>> Java applets is compiled from Java to Java byte code
>> by the developer somewhere and compiled from Java byte
[quoted text clipped - 6 lines]
> delay, either directly from source-code or very quickly
> compiled.
The JIT compilation happens in the background during execution
and should be invisible to the user.
Arne