Welcome!

BroadwayWorld.com - the Premiere Theater Site on the Net

Robert Diamond

Subscribe to Robert Diamond: eMailAlertsEmail Alerts
Get Robert Diamond via: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn


Related Topics: ColdFusion on Ulitzer

CFDJ: Article

Speed!

Speed!

One of the topics that comes up most often when talking with CF developers about ColdFusion is performance. Recently, I assisted two CF developer friends with some site speed problems that they were having. One of them is a beginner, a developer who couldn't understand why his site was running slow, or why his Web hosting company was yelling at him that his pages were spiking CPU usage on their server (the horror!). He runs a fairly well-trafficked Web site, and is truly representative of the fact that CFML is a language that will let a novice get up and running fairly quickly, with just an idea and a little bit of technical know-how to put together a professional looking site.

It also shows that while CF enables folks to do this, a few months down the line, as site traffic starts to build - most will hit a bit of a roadblock. After a few hours of work going through his code, I had his site up and running significantly faster, mostly from fixing some of the usual "rookie mistakes." Among the most notable of these: every query involved a 'select *' grabbing much more data than necessary; most pages were selecting the same data over and over again using some of the strangest CFLOOPs that I've ever seen, many running the same query several times over instead of using joins or relational databases, and of course, not a single thing on his site was cached. Fixing all of these was relatively straightforward, and later that week he received a lovely thank you e-card from his Web site provider.

The second friend's site was a bit more tricky (more advanced developers always get themselves into bigger problems), and required more than just run-of-the-mill scans over code. Everything looked okay at a quick glance, and it wasn't until we started to use CF's built-in query debuggers to display execution times that we began to get to the bottom of his problem.

Ultimately, we were able to improve things by using a combination of new stored procedures in his SQL database, better passing along of session variables to eliminate redundant queries, and a run-through of the settings in CF Admin to tweak the number of pages processing. Again, he had no queries cached.

The bottom line here is that the ColdFusion server can often run only as well as its worst queries and its most poorly written pages. There's a never-ending list of tips here each month in CFDJ, as well as all over Macromedia's and the other major CF sites out there, for improving code and site performance. All of them are worth looking at. I recommend setting aside a day, and focusing just on improving site performance, going through all that code you wrote while starting out and never went back to fix, etc. It's all good info, and you, your server, and your customers will appreciate it.

A few small items of note from around the industry... The fascinating progress over at Macromedia.com has continued this month, as they give an unprecendented look "under the hood." Not only is it refreshing to see a company using their own products and putting their challenges out front, but for those of us whose livings are intertwined with Macromedia's products, it ranks near the top of the most useful case studies we've ever seen. On the CFDJ front - voting for the ColdFusion Developer's Journal 2003 Readers' Choice Awards is now under way. Hundreds of developers have cast their votes so far, and polls will be open through the end of August. Don't delay, come vote today! ( www.sys-con.com/coldfusion/readerschoice2003)

One other note - only a few months after I said I would, I've begun blogging. Follow my nutty little world at www.robertdiamond.com.

More Stories By Robert Diamond

Robert Diamond is the founder and editor-in-chief of BroadwayWorld.com, the premiere theater site on the net now receiving over 100,000 unique visitors a day. He is also the owner of Wisdom Digital Media - a leading designer of entertainment and technology web sites. He is also the lead producer on BroadwayWorld.com's consistently sold-out Joe's Pub concert series, and Standing Ovations benefit concerts. Diamond was also named one of the "Top thirty magazine industry executives under the age of 30" by Folio magazine. Robert holds a BS degree in information management and technology from the School of Information Studies at Syracuse University. Visit his blog at www.robertdiamond.com.

Comments (1) View Comments

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


Most Recent Comments
Jason Hill 05/08/03 01:30:00 PM EDT

Hello Robert,

I appreciate your newsletter. I am a novice CF developer myself. And, as far as I know, my SELECT queries and CFLOOPS all work fine. However, I am convinced by this article that, like the first guy, there must be a lot of rom for improvent. Can I maybe send you a few lines of my "typical" code to make any suggestions? And right off the bat, can you direct me to some help in building Stored Procedures in SQL Server as well as relational and joins on database queries. Would these be good suggestions even if I am dealing with minimal records, like 1000?

Thanks for your help.
I really do appreciate it.

Jason
jhill@visualadv.com
(925) 417 - 8783