Sean, Forgive me for pressing the issue, but I think it's critically important here for people to understand what is and isn't happening in your test. You say "I know they don't tell you 'real world' performance but it was interesting nonetheless," but I would think that all interest is lost unless there is some relation to real applications. Publishing numbers like this can mislead a lot of people in very wrong directions.
First, CFIMPORT is running only once, but the x:tag is being called 100,000 times. In the real world, CFIMPORT would be called on every page using a custom tag. Second, you're not using an entire library of custom tags, so CFIMPORT isn't doing anything near what it would in a real application, where it has to import an entire directory of custom tags every time it is called on a page request (not just once before a loop within a single page). Third, you're calling all syntaxes on the same page. I would think this would skew the numbers substantially, even though you're separately timing each. Fourth, your CF_tag example has the tag in the same directory as the calling template, so you're not getting any hit from having to search for the tag, which typically happens in real applications. If these points I make are not well founded then please let me know. This is a very important issue for a lot of people. I'm not trying to harsh on you at all; I just need to acid test the premises I have been going on, and I sincerely appreciate your help with this. Respectfully, Adam Phillip Churvis Member of Team Macromedia Advanced Intensive ColdFusion MX Training ColdFusion MX Master Class: September 22 - 26, 2003 http://www.ColdFusionTraining.com Download CommerceBlocks V2.1 and LoRCAT from http://www.ProductivityEnhancement.com The ColdFusion MX Bible is in bookstores now! ----- Original Message ----- From: "Sean A Corfield" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Friday, September 19, 2003 9:02 PM Subject: Re: So... cfmodule is slow...? > On Friday, Sep 19, 2003, at 16:24 US/Pacific, Sean A Corfield wrote: > > "slow" in comparison to, say, CFC method invocation. > > So I went back and did some linear timings... yeah, I know they don't > tell you 'real world' performance but it was interesting nonetheless: > > I ran these three tests in a long loop: > > #1: <cf_tag> (with tag.cfm in same directory) > > #2: <cfmodule template="tag.cfm"> > > #3: <cfimport taglib="." prefix="x"/> > <x:tag> > > <x:tag> was the fastest - by quite a margin; next was <cf_tag>; slowest > was <cfmodule>. There wasn't a huge difference between <cf_tag> and > <cfmodule> tho'. Here's a sample result for 100,000 iterations: > > cf_tag: 12148 > cfmodule: 13497 > x:tag: 9465 > > tag.cfm contains just: > <cfoutput></cfoutput> > > The test file looks like this: > > <cfoutput> > <cfset a = getTickCount()/> > <cfloop index="i" from="1" to="100000"> > <cf_tag> > </cfloop> > <cfset b = getTickCount()/> > cf_tag: #b-a#<br /> > <cfset a = getTickCount()/> > <cfloop index="i" from="1" to="100000"> > <cfmodule template="tag.cfm"> > </cfloop> > <cfset b = getTickCount()/> > cfmodule: #b-a#<br /> > <cfimport taglib="." prefix="x" /> > <cfset a = getTickCount()/> > <cfloop index="i" from="1" to="100000"> > <x:tag> > </cfloop> > <cfset b = getTickCount()/> > x:tag: #b-a#<br /> > </cfoutput> > > Sean A Corfield -- http://www.corfield.org/blog/ > > "If you're not annoying somebody, you're not really alive." > -- Margaret Atwood > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm?link=i:4:137786 Archives: http://www.houseoffusion.com/lists.cfm?link=t:4 Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Get the mailserver that powers this list at http://www.coolfusion.com