David Harris's Technology Blog

ColdFusion, Flex, and other stuff...   (and 357,345 hours, 30 mins in to my plan for global domination)

Search:

Calendar:

Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    

Subscribe:

Enter your email address to subscribe to this blog.

Archives By Subject:

Tags:

action script adobe air ajax cfug coldfusion flash flex frameworks free software fxug general jpgmetadatareader mac off topic opensource papervision spry

Recent Entries:

No recent entries.

Top Posts:

Recent Comments:

Top Commenters:

My Links:

RSS:


*WHY* is CF8 so quick?

answer: Cause the ColdFusion Development team did lots of work!

When I started hear about how fast CF8 was I asked my self the question "I wonder how much of this is to do with the fact that CF8 is running on Java 6?"

I decided to run a quick test.

With my CF8 deployed on my old Jrun setup, using JVM 1.4.2, I did the olde (worst) load test and looped over instantiating CFC lots of times.

Here is my code:

Bob.cfc

<cfcomponent output="false">

</cfcomponent>

Bob.cfm

<cfset iCount = 10000>


<cfset tcOne   = getTickCount()>

<cfloop from="1" to="#iCount#" index="iIndex">

   <cfset oBob   = createObject("component","bob")>

</cfloop>

<cfset tcTwo   = getTickCount()>

<cfoutput>
   <h2>Creating an object #iCount# times</h2>
   <p>
      Total: #tcTwo - tcOne# ms
   </p>
   <p>
      Average #(tcTwo - tcOne) / iCount# ms
   </p>
</cfoutput>

CF7 Results:

Creating an object 10000 times Total: 28250 ms

Average 2.825 ms

CF8 Results:

Creating an object 10000 times Total: 5890 ms

Average 0.589 ms

So, while I suspect having a newer JVM to back up CF8 installs *helps* with speed, it looks to me that it's a lot more than the JVM making it go like a scorpion strapped to a large rocket! :-)

Comments
Performance was treated like any other feature in ColdFusion 8 (<cfimage>, <cfpdf>, etc.), so it was given engineering and QA hours. Nearly every tag was analyzed and refactored. The CF team benchmarked against applications using the big 4 frameworks (Fusebox, Mach ii, Model-Glue & ColdSpring)!
# Posted By Adrock | 7/4/07 12:40 AM
That's great Adrock.
Thanks for the comment, and keep up the good work!
# Posted By David | 7/4/07 7:47 AM
I stumbled upon this thread doing some Googleing on the CFC instantiation speed for CF8.
After not being able to replicate Adobe's stated speed of around 200ms for the creation of 10,000 cfc instances (http://www.adobe.com/products/coldfusion/pdfs/cf8_...) I decided to see what impact changing the cache settings had.
It turns out that if you enable Trusted Cache in the cfide, it has a MASSIVE impact on bulk-CFC creation. After turning on trusted cache
we are getting numbers of around 250ms for 10,000 instances!
It turns out that if you don't have trusted cache turned on then for each CFC creation in a loop, coldfusion does around FORTY low-level harddisk actions (as measured by the File Monitor from sysinternals.com). NB: The amount of low-level actions depends on how many folders deep your CFC is stored.
Unbelievably, without trusted cache turned on, CF repeatedly reads the CFC off the harddisk even within the same request.
Surely this should be cached within the same request automatically ...
# Posted By Jens | 8/6/07 1:26 AM