$10K coding deathmatch

Bryan Sant bryan.sant at gmail.com
Fri Nov 3 15:48:36 MST 2006


On 11/3/06, Chris Carey <chris.carey at gmail.com> wrote:
> On 11/3/06, Barry Roberts <blr at robertsr.us> wrote:
> > Java start-up time is big enough you're never gonna win the 5-line
> > test, but I can't resist suggesting this short-ciruit optimzation to
> > see how much difference it makes, since all the others do it.
>
> Can you preload the JVM in memory?

Java 7 will have the ability to keep the JVM resident, but no, today
you can't pre-load the JVM.  That's not really the issue though.  The
reason that extremely short-running programs don't do well in Java is
because the JVM takes a few milliseconds to compile the .class file
byte-code to native machine code.  However, the machine code that the
JVM produces is very optimized and executes very fast.  You just need
a program that runs long enough to marginalize the initial compile
cost (which is less that a second).

Java 7 also solves this problem by allowing that native code to be
cached and used the next time you run (or even distributed with your
java app).

Then again, I think perl 6 should be out by the time Java 7 comes out,
and will likely be even faster too.

-Bryan



More information about the PLUG mailing list