by Doug Boude, CFUnited Correspondent
I didn't have very high expectations when I walked into this session. The title seemed too ambiguous to hold the speaker to any real direction. But I invested the hour because like many other developers, I really want 'Success' and 'Better Applications.' The session actually did have a very clear direction and content. I came away from Simon's presentation more empowered than I was when I walked in.
Simon began with what it means to achieve success on a web development project. The metrics he uses to measure this are:
We were immediately immersed in the topic of Good Code Efficiency and inundated with useful, practical information. For instance, since Coldfusion is built upon Java, Simon explained the Java-centric subject of garbage collection. This is how the server frees up memory no longer in use, a very important action that improves performance. Through illustrations, Simon explained the process, then used the concept as a springboard to show why declaring private variables with the var keyword is more than just a good thing to do: it has a direct impact on how efficient garbage collection behaves.
Another very good point Simon shared was the SE factor: search engines, and the impact they can have on code that isn't written with them in mind. For example, if you have code that consumes a lot of resources, like multiple object creation, setting of complex session variable values, etc, search engine spiders and bots can potentially bring your server to its knees in very short order. Every time a bot or spider visits your site, it creates a new session. If your site gets medium to high traffic, and you have heavy initialization code, search engines will become your nemesis.
Simon also touched upon the great value of using CFIMPORT to import your custom tag libraries rather than call them, just for the amount of file I/O you can save. Using CFSCRIPT reduces the amount of whitespace returned by ColdFusion to the browser! This, in turn, reduces the size of the packet returned and thus the speed of the page load.
Another very interesting concept that Simon introduced is resource pooling. Picture, if you will, an e-commerce site that uses a shopping cart object for each shopper. Simon's idea is this: upon application instantiation (which is one-time), create a pool of say 100 instances of the shopping cart object and persist them in the application scope. When a user needs a cart, assign them a publicly available cart. By doing this, you remove the overhead and time needed for object instantiation, which up till version 7.02 is fairly resource-intensive. Simon has written a "resource pool manager" and he said it is available on his blog, if you're interested in pursuing this methodology.
A few other notable tips:
Simon, my hat's off to you for making the hour invested with you an hour VERY well spent!
Having spent four years disarming bombs for the Air Force, Doug Boude is now a Senior Web Application Architect for Fiserv Health in San Antonio, TX. He has been developing with ColdFusion since version 4.0.