On Friday, Nov 8, 2002, at 12:58 US/Pacific, jon hall wrote:
> Check the below code out, I am seeing a significant performance hit 
> when
> looping over a cfc method as opposed to doing basically the same thing
> inline. The inline code is about 350 times as fast as the cfc! If I
> take the add function out of the cfc, and put into add.cfm the
> performance is about the same. That means the performance penalty is
> coming from the cfc framework entirely.

Here's what I see for 5000 iterations:

7602 ms - cfc
69 ms - inline
160 ms - UDF on this page
148 ms - included UDF

So that's about a 2-3x factor for a UDF and a 10-11x factor for a CFC. 
Not sure where you got '350' from. Don't forget that on the first hit, 
the CFC needs to be compiled so you need to get the timings from second 
and subsequent runs.

A CFC invocation is taking about 1.5ms - which isn't bad considering 
it's resolving the reference and calling out to another .class file 
with all the overhead you might expect on that sort of thing. It does, 
however, seem a little strange that the difference between a UDF and a 
CFC invocation is so dramatic. I'll ask some of the product team folks 
to comment.

Sean A Corfield -- http://www.corfield.org/blog/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Reply via email to