just to throw in my bit ;) the original post said the "slow" code executed in 811 milliseconds (0.811 seconds) and the fast code in 370 milliseconds (0.37 seconds).
If there are 1000 page views that is 811 seconds to execute the old code and 370 to execute the new, a saving of 441 seconds (7 minutes & 21 seconds) of processing time, even if this was the only page on the site that could produce a saving and only half the visitors to the site visited it only once, it is clear to see that on a high volume site some substantial savings can be made. -- Jay [EMAIL PROTECTED] "Computer games don't affect kids, I mean if Pac Man affected us as kids, we'd all be running around in darkened rooms, munching pills and listening to repetitive music..." ----- Original Message ----- From: "Jon Hall" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Friday, August 16, 2002 9:52 AM Subject: Re: Best Practices > So one iteration of the former executes in .811 milliseconds and the > latter .37 milliseconds? No one is ever going to notice that. > > What someone who comes from any other language under the sun will > notice though, is that len() returns an int and not a boolean. So why > would someone be doing a boolean test on it? > > -- > jon > mailto:[EMAIL PROTECTED] > > Friday, August 16, 2002, 3:25:14 AM, you wrote: > > DB> Yes, but you also have to take performance into consideration > > DB> Example > > DB> <cfset myString = ""> > DB> <cfloop from="1" to="1000" index="i"> > DB> <cfif myString EQ ""> > DB> Hello > DB> </cfif> > DB> </cfloop> > DB> Execution Time > > DB> 811 milliseconds > DB> Compared to > DB> <cfset myString = "1"><cfloop from="1" to="1000" index="i"><cfif > len(myString)>>Hello</cfif></cfloop> > DB> Execution Time 370 milliseconds > > ______________________________________________________________________ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists