A CFC has more overhead then a UDF simply because it has more features -
access type, security (although you can use roles in UDFs defined in
cffunction), state with the This scope, etc. It's not fair to expect a
UDF call to 1-1 with a CFC method call when a CFC method has more going
on.

=======================================================================
Raymond Camden, ColdFusion Jedi Master for Hire

Email    : [EMAIL PROTECTED]
WWW      : www.camdenfamily.com/morpheus
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

> -----Original Message-----
> From: Robert Everland [mailto:REverland@;dixonusa.com] 
> Sent: Friday, November 08, 2002 4:34 PM
> To: CF-Talk
> Subject: RE: Really bad cfc performance?
> 
> 
> Speed isn't everything, it's the only thing. 
> 
> Seriously though, what I would like to see is a time difference with 3
> algorithms that do the exact same thing. 1 done in CFC, one 
> done in UDF, and
> one done in inline code. If UDF and CFC execute the same, I 
> can handle that,
> BUT if CFC is slower than UDF I must ask why.
> 
> Robert Everland III
> Web Developer Extraordinaire
> Dixon Ticonderoga Company
> http://www.dixonusa.com 
> 
> -----Original Message-----
> From: Raymond Camden [mailto:jedimaster@;macromedia.com] 
> Sent: Friday, November 08, 2002 4:32 PM
> To: CF-Talk
> Subject: RE: Really bad cfc performance?
> 
> 
> > The code I sent was just to illustrate the fact that no matter how 
> > optimized the code is within a cfc, there is a minimum 
> amount of time 
> > a cfc is going to take to execute.
> 
> Right - and this is to be expected.
> 
> > Specifically what I was trying to optimize was a check to see of an 
> > email address was a duplicate, valid, and not in a remove 
> list. This 
> > would require 2 database queries and a run through the validate 
> > method. I eliminated the need for the two queries by using query of 
> > queries, but was unable to get barely any performance 
> gain...every cfc 
> > call is taking ~15ms, no matter what.
> 
> 15ms seems a bit high. However, remember that the point here is
> encapsulation. By having your 'isDupe' method stored in one central
> location, you can easily update the code w/o worrying about 
> other templates
> that may have had their own versions. You could also add 
> security. I won't
> go on - I love CFCs and it's obvious.
> 
> The point remains the same. The _fastest_ code will almost 
> always be inline
> code. However, speed isn't everything.
> 
> -ray
> 
> 
> 
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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