...Jordan Clark [mailto:[EMAIL PROTECTED]] wrote...
> I would argue about a few of your suggestions,
>
> First don't use compare() instead of <cfif foo IS 'bar'> since compare is
> case sensitive
Mister D explained that one... That was one of the few things I took away
from his brief stint consulting for a former employer. ;)
> You can not do <cftag name="foo"> value=#var#> on any type of strings
I'm not quite sure what you mean... I pulled that one out of Mastering Cold
Fusion 4.
Rough example: <cfquery datasource="#DS#"> is slower than <cfquery
datasource=#DS#>
I certainly haven't had any problems using it all over the friggin place. If
you know of any problems with it, let me know.
> Always avoid IIF() because it is up to 4x slower then <cfif> even if it is
> nested
Huh. I guess I'm not sure how bad nested if statements really are. I seem to
remember someone saying if you're nested more than two or three levels and
IIF'll get you out of another level you should use it, but not using it does
seem to make sense.
> Don't lock the request scope, because it is thread safe by design!
Huh. Fortunately I never use the request scope. ;)
> Lock application, session, & server scopes
>
> Take Care,
>
> Jordan Clark
Here's my revised version. I know somebody out there's gotta have a better
list than me. ;)
--------------------------
Use cfscript wherever possible, for as long as possible
Boolean evaluation wherever possible
Scope all the variables that you can
Use cfmodule instead of short hand annotation for custom tags
Use cfinclude instead of cfmodule wherever possible
Use cfquery's instead of cfinserts, etc.
Cache queries that seldom change and are universal to all users of the site
Use stored procedures for non-cacheable queries
Prepublish pages that are the same every time
Make sure your queries are return only what you need
Always name rows in queries, instead of select *
<cfset #x# = "#Func(y)#"> is bad
<cfset x = Func(y)> is good
<cfscript>x = Func(y);</cfscript> is spiffy keen
Use functions instead of operators wherever possible, e.g. Find/FindNoCase
instead of CONTAINS, CompareNoCase instead of "var is 'whatever'
Don't use CFHTTP resolveUrl=yes unless you need the fully qualified URLs for
everything returned.
Locale functions (LSFunc) are slower than English-only functions
<cftag name="foo" value="#var#"> is slower than <cftag name="foo"
value=#var#>
Use cfswitch instead of cfif
Avoid IIF. Really.
Structures are referenced, but arrays are copied, so if you're using large
arrays and you try to do something like LocalCustomerArray =
DataStore.CustomerArrays[CustomerID] you'll end up copying the entire array,
which is ok if you just want the data, but is never gonna change the
DataStore unless you do DataStore.CustomerArrays[CustomerID] =
LocalCustomerArray again. think twice before copying big arrays
Arrays are dynamic (and they start at 1!)... thus you can't count on
myArray[15] continuing to be myArray[15] for very long.
CFLOCK all references to Session variables
CFLOCK all references to Application and Server variables that might be
altered over the life of the [Application,Server]
CFLOCK all CFHTTP, CFFTP, CFFILE, CFDIRECTORY tags and all CFX's
Consider using <cfsetting enablecfoutputonly="yes"> or automatic whitespace
reduction to reduce overall page size. cfsetting is faster if it's only done
a few times, but if it ends up getting set fifty times in the course of
processing one request, you probably want automatic reduction
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.