At DevCon there was a session that proved the order of speed of execution
performing similar operations...

UDF - Fastest
Custom Tag
CFC - Slowest,

Jb.

-----Original Message-----
From: jon hall [mailto:jonhall@;ozline.net] 
Sent: 08 November 2002 22:22
To: CF-Talk
Subject: Re: Really bad cfc performance?

I just tested with an include and it performed very badly...worse than
the cfc...which confuses me a bit, but there is some obvious optimization
that could be done here in the CF backend...

<cfset start3 = getTickCount()>
<cfloop from="1" to="5000" index="i">
        <cfinclude template="addtag.cfm">
</cfloop>
<cfset end3 = getTickCount()>

<cfset time3 = end3 - start3>
<cfoutput>#time3# ms</cfoutput>


addtag.cfm
---------
<cfset rs = 1 + 1>

Seems like UDF's are the way to go for encapsulating logic where
performance is an issue.

-- 
 jon
 mailto:jonhall@;ozline.net

Friday, November 8, 2002, 4:44:48 PM, you wrote:
RE> Ok then will it have the same performance of an include?

RE> Robert Everland III
RE> Web Developer Extraordinaire
RE> Dixon Ticonderoga Company
RE> http://www.dixonusa.com 

RE> -----Original Message-----
RE> From: Raymond Camden [mailto:jedimaster@;macromedia.com] 
RE> Sent: Friday, November 08, 2002 4:43 PM
RE> To: CF-Talk
RE> Subject: RE: Really bad cfc performance?


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

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

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

RE> "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
>> 
>> 
>> 
>> 

RE> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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
Get the mailserver that powers this list at http://www.coolfusion.com

Reply via email to