Accessibility

Logged In

Phil Costa

Phil Costa

Macromedia, Inc.

View Previous Columns

Boosting Performance in ColdFusion MX 6.1

Note: Macromedia ColdFusion MX 6.1 is now available for trial and purchase.


If you've already installed ColdFusion MX 6.1, you can't help but notice the change. Everything just goes faster. First, your pages compile more quickly, so you can focus on building your solution, rather than waiting for your page to compile. Perhaps most significant, however, are the production runtime performance and scalability improvements, providing up to 50% better performance than ColdFusion MX, up to double the performance of ColdFusion 5, and up to 10 times the performance of ColdFusion 4.5! As a result, your applications are snappier and you can put off buying that new rack server, despite the growth in traffic.

There are lots of great things to talk about in ColdFusion MX 6.1—enhancements in the CFMAIL and CFHTTP tags, and components; updates to the web services engine; and support for multiple instances in ColdFusion MX 6.1 Enterprise version. But one of the most exciting features of ColdFusion MX 6.1 is the performance increase. While developing this release, the ColdFusion team devoted thousands of hours to testing and improving performance, and we expect everyone to benefit from the results.

Detailed benchmarks on ColdFusion MX 6.1 performance are on the way, but rather than simply tell you about performance, we thought it would be more fun to give you a peek behind the scenes and talk about how we got there. First, we'll talk about some of the exciting changes in the CFML compiler. Then, we'll look at the process we followed to deliver a significant boost in performance.

Optimizing the Compiler

For any long-time ColdFusion customer, moving to ColdFusion MX meant a noticeable change in the development process. Prior to ColdFusion MX, you could write some code, save it, and immediately view the results. This was a basic part of the development process. By contrast, with ColdFusion MX, it took a few seconds before the server would let you view a new page. While the actual difference was small, it broke your rhythm and made the process feel slower.

The reason behind this change was the ColdFusion compiler in ColdFusion MX. As described in many prior articles, CFML is no longer an interpreted language. Rather, the CFML compiler takes your code and produces compiled Java bytecode. As a result, your applications can run a lot faster in production and integrate more closely with other Java applications on the server. The only problem was that initial compilation step. Since ColdFusion development is iterative, a longer compilation time meant you had to wait longer before you could see an error or move on to the next step.

In ColdFusion MX 6.1, we addressed this issue by changing the compilation from a two-step process to a one-step process. Whereas ColdFusion MX converted CFML into Java source code then compiled it into Java bytecode (two steps), ColdFusion MX 6.1 now compiles CFML directly into Java bytecode (one step) without producing any Java source code. The result is a tenfold increase in compiler performance, and a much better development experience, making it easier to build and debug applications without waiting for pages to recompile.

Obviously, there is a lot more to this process than explained above, but there isn't room to cover the topic in depth in this column. If you're interested in more details, you'll have to track down some of our developers at the upcoming MAX 2003 User Conference in November! For now, you can read some of the in-depth articles on ColdFusion MX 6.1, listed at the end of this column.

While improvements in compilation are definitely important to developers, in the end, the most important thing is that your applications perform well in production. Accordingly, that's where we spent the most time during the development of ColdFusion MX 6.1.

Tuning the Runtime

Some of the performance gains in ColdFusion MX 6.1 come from updates to the underlying components of ColdFusion. For instance, ColdFusion MX 6.1 comes with version 1.4.2 of the Sun JVM, as well as a new version of the JDBC database drivers. These updates greatly contribute to the performance improvements; however, the lion's share of the change comes from tuning changes made to the runtime engine.

To ensure that we focused our energy on the right areas, we structured our approach to performance tuning. First, we analyzed our internal library of customer applications (about 2.3 million lines of CFML code) to determine the “Top 20 Tags and Functions.” The development team then created a specially-designed test bed on an eight-processor Intel Xeon machine and analyzed the internal execution path and time distribution under load for each tag and function, removing as many bottlenecks as possible.

Once we completed this process, we worked closely with a number of key customers to verify our optimizations and to identify further candidates for tuning. For example, we instrumented a version of the Macromedia website to determine exactly where the application spent its time. We invited Fusetalk, Inc. to analyze their applications and to identify additional internal code areas that we could optimize. (Thank you, Jason Clark and the folks at FuseTalk, for taking the weekend to drive down from Canada to help us out, by the way!). We brought in other applications as well, such as those written with the Fusebox methodology, since Fusebox has a large and loyal following.

Of course, we also worked with over 2,000 beta testers to ensure that we did not break anything in the process. This is important—by definition, making performance changes that will benefit all customers meant that we tuned and changed code that affects all customers.

As a result of this process, we iterated over dozens of areas where small changes resulted in significant performance improvements. The cumulative result is the fastest and most reliable release of ColdFusion ever to see daylight. If you haven't already taken ColdFusion MX 6.1 for a spin, I strongly recommend you take a look. And be sure to check out the following articles on the new version:


About the author

Phil Costa is the Senior Product Manager for Macromedia ColdFusion. Prior to joining Macromedia in 2001, he held product and corporate marketing positions at Allaire Corporation and helped lead XML and Internet middleware research at Giga Information Group.

 

Submit feedback on our tutorials, articles, and sample applications.