Java and CFC instantiation, comparing ColdFusion engines

Posted At : November 30, 2006 10:52 AM | Posted By : Mark Drew
Related Categories: coldfusion

Yesterday I posted my comparative tests between creating a CFC and a Java object, Andy Jarett mentioned in a post that I should try out the different engines: Adobe ColdFusion, BlueDragon and Railo and see how they stacked up against each other. So I run the *SAME* code on each of the engines, of course I had to put my Generic.jar file into the classpath for each engine to have access to it.

In the test I used Bluedragon 6.2.1, Coldfusion MX 7.0.2 and Railo 1.1, and pointed them to the same webroot*.

The results are fairly erratic but that is because I didnt run them a number of times, no, I didnt put trusted cache on all the engines, as I know this should improve performance but it is comparative right?

So, the results?

They speak for themselves. At the end of the day its a lot faster to use a Java class than a CFC.

CFC based GenericBean

Java based GenericBean

*I shall provide details on how to do this later on today

Related Blog Entries

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Tom Chiverton's Gravatar This series has really woken me up to Railo because of it's less steep performance hit as the number of items increase compared to both of the other two CFML engines.
# Posted By Tom Chiverton | 11/30/06 11:45 AM
Mark Drew's Gravatar It does seem to have big optimisations in it, now if you look at the instantation of Java classes both CFMX and Railo are comparablie really.. .there isnt much difference in it.
# Posted By Mark Drew | 11/30/06 11:55 AM
Tom Chiverton's Gravatar @Mark: Railo was also a better performer in your other tests.
# Posted By Tom Chiverton | 11/30/06 12:57 PM
Mike Rankin's Gravatar @Mark - This has been a very interesting experiment. I know lots of people would like to have definitive answers on these performance issues (if they exist).

1. What are we getting for the additional overhead? Are we getting some added functionality with cf and bd because all of their objects extend the generic object? Is it worth it/necessary?
2. Do you think you would get similar results on different operating systems or with different jvms?
3. Is cfc performance on the cf8 plate?

I could see this being of great importance to those that wish to return arrays of objects from their gateway components. While in some cases, like flex/remoting, you might need to do that in order for the client to be able to make sense of the results, but for straight cf, I generally just return a recordset and save bean instantiation for the details.
# Posted By Mike Rankin | 11/30/06 1:30 PM
Brian Rinaldi's Gravatar At the Boston CFUG last night, Tim Buntel presented on Scorpio and I specifically asked the question about cfc performance. He discussed that there is a stage in the development of each version that is dedicated to improving performance and trying to remove known bottlenecks. He indicated that the engineering team is aware of this issue, but could not say at this point what, if any, outcome that would mean. Nonetheless, this, to me, makes it seem a fairly safe assumption that this issue will be tackled and at the very least improved for CF8.
# Posted By Brian Rinaldi | 11/30/06 1:53 PM
Alex Skinner's Gravatar Are you really comparing the cf engines themselves was this
BDJX vs CFMX 7.02 on Jrun Vs Railo

or BD vs cfmx 7.02 vs Railo all running on the same underlying j2ee server
with the same default jvm settings etc. If not is it a true comparison ?
# Posted By Alex Skinner | 11/30/06 1:55 PM
Mark Drew's Gravatar Alex, you are right, its not a *true* comparison, but I shall try and deploy Railo and BD onto JRun and re-run them if you wish.

They are "default" installs of the engines, i.e. I downloaded it and run it. if this is an issue for you then I can re-do the tests. The tests in themeselves are more pointing to the use of CFC's vs Java objects as has been the whole trend of my recent posts, so I am not going to start doing specific performance metrics.

I havent *tweaked* any of the engines and I am sure you can eek more speed out of them with individual tunings, but this is kind of "out of the box" installs.
# Posted By Mark Drew | 11/30/06 2:07 PM
Patrick Whittingham's Gravatar Mark -

These have been an interesting set of blog entries. I've done some performance testing on cf 5/cfmx 7.0.2 in regards to cfinclude, custom tags, cfscript, cfc, createobject and have found cfc lacking. I don't code for my performance (ie., frameworks) but the user performance.
# Posted By Patrick Whittingham | 11/30/06 5:35 PM
Alex Skinner's Gravatar Mark,
Fair enough, i'd only seen this post, I was curious to find our more about the
test platform. Your observations with cfcs are similar
to mine actually. Which is why when we wrote our framework for the
core api using UDFs. And only used cfcs where it made sense i.e it wasnt
a simple library of functions.
Id be interested to see the performance of BD7.0 beta 2 in the mix.
# Posted By Alex Skinner | 11/30/06 10:07 PM
Mark Drew's Gravatar Once I get BlueDragon running using my webroot I can let you know, I should download the beta at some point. But to be honest, that wasnt the direction I was taking, I didnt want to do a "Best CF engine" comparison but just a warning to people using different engines to create CFCs.

MD
# Posted By Mark Drew | 11/30/06 10:35 PM
Tom Chiverton's Gravatar @Alex: Sounds like overkill - a framework should only be creating it's objects once and then caching them. We use CFC based 'frameworks' such as Reactor/ColdSpring without noticable performance hits. Mind you, we refuse to return 2000 records at once as VOs :-)
# Posted By Tom Chiverton | 12/1/06 9:13 AM
Stephanie Keppler's Gravatar I am really impressed by your tests. Thanks a lot. Have you made any other performance tests yet? I would like to see how BD and Railo compete with MX7.

Stephanie
# Posted By Stephanie Keppler | 12/1/06 11:19 AM
Mark Drew's Gravatar I havent as yet, I just installed BlueDragon on JRun but I cant change the document path for some reason so it looks in the same place as CF and Railo are doing, I will just have to copy the tests over to BD webroot. Then I shall do a few runs to get some results

MD
# Posted By Mark Drew | 12/1/06 11:31 AM
Vince Bonfanti's Gravatar While the results may "speak for themselves," they deceive and mislead. :-)

See my response here:

http://blog.newatlanta.com/index.cfm?mode=entry&am...
# Posted By Vince Bonfanti | 12/13/06 3:10 AM