> Is there any definitive info on whether it is more efficient 
> to put a CFTRY around an entire page's contents, with a
> CFCATCH at the end to trap errors, or to simply have a CFERROR 
> page specified in application.cfm (and only use CFTRY/CFCATCH in 
> specific pieces of code that might need special error handling
> procedures)? In other words, what is the performance cost for 
> code that is executing within a CFTRY block?
> 
> I'm interested in this because the CF server that I've just 
> recently started working with seems to be having periodic 
> performance problems (still trying to determine what "periodic" 
> actually means), and noticed that a lot of the application's 
> pages have a single CFTRY around them.

I think you're asking the wrong question. I seriously doubt whether there
are any significant performance implications one way or the other. However,
wrapping a CFTRY around a page is bad, bad, bad! That's not what it's for -
that's why we have CFERROR. Wrapping a CFTRY around a page prevents you from
using CFTRY usefully within that page. The purpose of exception handling is
to let you identify and trap specific problems, and provide specific
solutions for those problems. When you wrap the entire page in CFTRY, your
problem could be on line 2 or line 200. Plus, it means that you have to
manage generalized error handling within each page, which is unnecessarily
complicated.

> I've also noticed excessive use of CFOUTPUT tags. Is it worth 
> consolidating these to help performance? I've seen as many as 
> 5 in a block of code that's only 30 lines long, where only 1 
> was needed.

I doubt you'd see any significant difference here, either.
 
> What about excessive # marks?  It makes me crazy to see code like
>       <cfif #somevariable# eq "yes"> ...
> But does that also make CF crazy?  I'd think that this 
> goofiness would not actually filter down to the Jrun code that 
> actually executes, right?

I don't think this makes any significant difference either.

> Any good MX7 performance/tuning papers running around? I 
> checked on the macromedia website, and with google, but only 
> found info on older versions.

To the extent that those older versions address CFMX 6.1, they should still
be largely valid for 7. There isn't that much difference, really. In
general, you're far more likely to improve performance by examining data
access and caching more closely.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized 
instruction at our training centers in Washington DC, Atlanta, 
Chicago, Baltimore, Northern Virginia, or on-site at your location. 
Visit http://training.figleaf.com/ for more information!


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:227954
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to