Hmm, I had always just figured that cfif and iif just compiled down to the exact same java anyway...
I wonder if one could have an advantage over the other if the condition was either true or false.... all this worrying over a few microseconds :) ~Brad -----Original Message----- From: Russ [mailto:[EMAIL PROTECTED] Sent: Sunday, July 23, 2006 12:30 AM To: CF-Talk Subject: RE: iif: am I understanding correctly? I wrote some test code, and it seems that cfif and iif perform similarly, and sometimes cfif ends up being slower? Is my test code flawed in some way? <cfset startTime=GetTickCount()> <cfloop from=1 to=100000 index=x> <cfoutput>#iif(isDefined("blah"),DE("."),DE(","))#</cfoutput> </cfloop> <cfset midTime=GetTickCount()> <cfloop from=1 to=100000 index=x> <cfoutput> <cfif isDefined("blah")> . <cfelse> , </cfif> </cfoutput> </cfloop> <cfset endTime=getTickCount()> <cfoutput><br>The time to do with IIF is #midtime-starttime#</cfoutput> <cfoutput><br>Time to do with cfif #endTime-midTime#</cfoutput> Russ > -----Original Message----- > From: Munson, Jacob [mailto:[EMAIL PROTECTED] > Sent: Friday, July 21, 2006 6:34 PM > To: CF-Talk > Subject: RE: iif: am I understanding correctly? > > > This part of the app is not going to take heavy traffic, so > > the performance > > hit would be negligible. However going forward I will always > > take into > > consideration the possible performance implications of > > iif/evaluate/DE. > > Yeah, and another thing to keep in mind when memorizing things that > perform better performance can change with new versions of CF. Or if > you move to a different app server, or different OS. That's why I said > I like to test my own code, if I'm worried, because I never believe the > 'general rules of thumb'. :) > > > --------------- > > This transmission may contain information that is privileged, confidential > and/or exempt from disclosure under applicable law. If you are not the > intended recipient, you are hereby notified that any disclosure, copying, > distribution, or use of the information contained herein (including any > reliance thereon) is STRICTLY PROHIBITED. If you received this > transmission in error, please immediately contact the sender and destroy > the material in its entirety, whether in electronic or hard copy format. > Thank you. A1. > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/cf_lists/message.cfm/forumid:4/messageid:247418 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

