Orange is my favorite color

Thanks to a tip from Elliott Sprehn on the Transfer list, I installed Java 1.6 u10 RC on my laptop to see how my Model-Glue/Transfer/Coldspring application performed with the JRE ClassLoader bug fixed. I’ve gotten in the habit of simply restarting my CF instance rather than reinitialize my application because it’s been faster in most cases (albeit annoying).

When my application is initialized, I time how long it takes to instantiate Coldspring and Model-Glue and typical startup times are somewhere around 25s and 32s respectively. The absolute time is not that important not to mention specific to my hardware and software setup but what is relevant is the change in times after switching to U10.

A quick recap, to switch your JRE to another version, first download the JDK RC from Sun for your operating system and install it. Then find your jvm.config file (typically in c:\jrun\jre for a multi-instance install on Windows or /opt/coldfusionmx/jre for Linux) and change the java.home line to point to the JRE directory of your new install. This is for my Windows install:

java.home=C:/Program Files/Java/jdk1.6.0_10/jre

That’s all there is to it. Now start up ColdFusion and you’ll be running on the new JRE. My stock JRE reported running VM version = 10.0-b19 and U10 reports back 11.0-b15. My next step was to start my application three times to find an approximate average time for application startup. Where before it was taking an average of 25s to initialize Coldspring and 32s to initialize Model-Glue, with U10 it is taking 19s and 17s respectively for a 23-48% improvement in start up speed. For a production environment this is great news: overall startup time is 38% less than before.

In an ideal world though, we wouldn’t restart the server every time we want to reinitialize the application. We would use the methods these frameworks make available like index.cfm?reinit=1. Because of the ClassLoader bug though, these restarts would take even longer than a fresh start, sometimes 2, 5 or even 10 times longer! While my tests are just a first look and are not exhaustive, my first application restart was shocking: Coldspring reinitialized in 2.7s and Model-Glue reinitialized in 8.9s! Since there isn’t the first-time hit to compile classes and verify the trusted cache (if enabled), this is what you would expect but would not have experienced using the stock JRE in CFMX8. With U10, the reinit completed in just 32% of the original startup time!

Until we run this through load testing (as we prepare to switch our production environment to CF8) we won’t know for sure that U10 doesn’t come with any undesired surprises but at first blush this is a big step up for CFMX8 applications. Even if you don’t want to use this in production, your development workflow will benefit greatly by the improved speed with CFC-heavy applications and frameworks.

Update Sep 4: – I installed this setup on a new production server, a Compaq DL360G4 with dual 3.6ghz Xeons and 4GB of RAM running CentOS 5.2 and the results were even more impressive on my first test. Under the stock JRE, the startup times were around 25s to initialize Coldspring and 58s for Model-Glue. With 1.6 U10 they were 10s and 14s respectively!!


  1. Sami Hoda said:

    on August 18, 2008 at 1:52 pm

    Nice! Will try this with Mach II.

  2. Michael Sharman said:

    on August 18, 2008 at 5:55 pm

    Finally :)

    Great news, thanks for the post

  3. Dan Wilson said:

    on August 19, 2008 at 5:53 am

    Thanks for the well documented post. I’ll be upgrading and testing myself pretty soon.


{ RSS feed for comments on this post}