I had this discussion with Dave Watts on Talk. When CFSCRIPT was first
introduced the script techniques were faster, with the introduction of MX
this disparity was corrected.

The original reasoning was that the CFSCRIPT block was processed all at once
as opposed to each cfset tag being processed individually. 

--
Scott Stewart
ColdFusion Developer
4405 Oakshyre Way
Raleigh, NC 27616
(h) 919.874.6229 (c) 703.220.2835

-----Original Message-----
From: Larry Lyons [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 02, 2008 7:57 AM
To: CF-Community
Subject: Re: interesting results with setting variables

That's about the only difference according to these results. It is faster,
but since I use a lot of snippets to do sets etc., even that isn't the case.
All I end up doing is typing the variable name, and that's about the same
effort using cfset or within a cfscript block.

> I don't think <cfscript> has been faster than tags since early MX
> (6.0?  6.1?), and even then, I'm not sure it was significantly faster
> in an average page.
> 
> what *is* faster, when setting large blocks of variables, is the time
> it takes to type.
> 
> <cfset myfirstvariable = "a" />
> <cfset mysecondvariable = "b" />
> <cfset mythirdvariable = "c" />
> <cfset myfourthvariable = "d" />
> <cfset myfifthvariable = "e" />
> 
> myfirstvariable = "a";
> mysecondvariable = "b";
> mythirdvariable="c";
> myfourthvariable="d";
> myfifthvariable="e";
> 
> just less verbose by virtue of the fact that you don't need to type
> out the "cfset" or the brackets.  maybe that's what they meant by
> "faster when setting large blocks of variables"?
> 
> On Tue, Jul 1, 2008 at 6:28 PM, Larry Lyons <[EMAIL PROTECTED]> 
> wrote:
> > OK I got into a discussion at my new job about setting variables by 
> the cfset tag or via a variable assignment using cfscript. The 
> consensus has been that when setting large blocks of variables using 
> cfscript is faster than cfset. The reason that tags are slower is that 
> when the template JITs, it adds extra libraries into the class. So 
> when you use cfscript, your code needs fewer cftag libraries mentioned 
> as Java import namespaces because your code is closer to the native 
> Java and requires less overhead. Also, the tag named import also 
> contains functionality you may not be using. Therefore, you have 
> thinner JITs and faster code.Or so I thought. Here's some code I wrote 
> to test this:
> 
> -- 
> A byte walks into a bar and orders a pint. Bartender asks him "What's
> wrong?" Byte says "Parity error." Bartender nods and says "Yeah, I
> thought you looked a bit off.
" 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Community/message.cfm/messageid:263231
Subscription: http://www.houseoffusion.com/groups/CF-Community/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.5

Reply via email to