My recent post, Timing is everything, started a mini-controversy. One that can teach you a lot about where Java is coming from, and where it’s heading.
Smart readers pointed out that Java’s raw performance will more than make up for any cost of startup time. Others pointed that so many applications are started once and left running for years. Those are all good and true.
So let me ask you this question: how well do you know Java?
I didn’t write the post to claim Java has a slow startup time, I wrote it to propose a different way of measuring things that will include the startup time. And in doing so I hit a few nerves.
So let’s take a break and look at the numbers for a second.
I’m measuring this on a 2GHz Duo Core 2, running Linux. The startup time for the JVM (Java 1.5) is 30x slower than the startup time for the Ruby interpreter (version 1.8.5). 30x is a freaking large number. But remember from my post that I wasn’t looking for relative numbers, but how long I, the user, am going to wait. How long?
About 0.1 seconds.
As fast as a blink.
This is 2006. In ’96 the startup time for the JVM was a serious issue you had to work around. Those days are long gone.
There’s no need to propose theories that explain and rationalize the incredibly sluggish startup time that never was. Java does not need to be excused.
Proving this is just a matter of firing up the command line and running:
time java Test time ruby test.rb
Of course, it uses time. And people who are caught in the slow startup myth, have a subconscious gag reflex when it comes to time. It’s amazing how myths can play with your head.
I ran this little test at home, so I knew Java didn’t have to worry about its startup speed. It’s more than adequate.
If your initial thoughts were to rationalize the supposedly poor startup time of Java, my apology for not laying out all the facts. But consider this. You may have internalized limitations of the language that no longer exist. Your knowledge of Java might be burdened with believes and myths, instead of facts.
In which case that post was written for you. Software adapts, hardware improves, requirements change. And every once in a while, we need to step back, forget all that we believe is true, and look at the situation with a fresh eye and an open mind. To judge that which is true now.
The point of my post was not that Java sucks and Ruby rocks. The point of my post is that, in the Java world, we still build software like it’s 1996. It’s time we let go of old believes and move on.
Refresh Your Mind – Hendy Irawan