Welcome!

You will be redirected in 30 seconds or close now.

ColdFusion Authors: Yakov Fain, Jeremy Geelan, Maureen O'Gara, Nancy Y. Nee, Tad Anderson

Related Topics: ColdFusion

ColdFusion: Article

Profiling CFML at the Tag Level, Finally!

Make short work of tuning

The ability to view tag-level execution profiling (the amount of time spent on each tag in a request) is no longer a dream, and it opens up powerful new forms of debugging and performance tuning.

The Problem: Tools We Lack
Most CFML developers know that both ColdFusion and BlueDragon can be configured to show debugging info at the bottom of a page, which shows (among other things) the total time spent on a request and in each template within that request.

But how often have you wished you could see the time spent on each tag within the request? This would really help in determining where specific bottlenecks exist. While seeing that timing information for each individual tag would be powerful enough, we really need to start a higher level. What we need is a way to view all the requests against the server for a given time period, viewing their total execution time in aggregate, so we can identify just which requests are indeed the longest-running and therefore deserve our closer attention.

All these kinds of profiling/tuning tools have long been available to other developers, but not to us CFML developers. Users of BlueDragon, though, will soon have just this kind of tool in the BlueDragon CFML Profiler (scheduled to be released later this year), which has been designed to address this very kind of challenge.

Solving a Real Problem with the Profiler
Rather than just talk about the tool, let's instead dive right into using it to solve an actual problem. To help both identify the problem and confirm the result of code changes, I've used a load testing tool to run a small set of requests executing a subset of the Macromedia example applications that come with ColdFusion.

It's not important to discuss the load testing tool, nor will I bother detailing the particular requests I ran in the test. And I certainly don't mean to disparage the examples. They weren't written to be demonstrations of well-tuned code but rather very simple examples which beginning CFML developers could easily understand. Even so, they do represent rather typical practices that many developers employ which can hold up performance.

With the Profiler enabled, I ran a simple short load test to run through some of the example pages. (The details of how to start and configure the profiler may change between now and its final release, so I won't elaborate on how it's started now.)

The profiler is an extension to the BlueDragon engine, using a very low-overhead mechanism (aspects) to create a stream of profiling data available on a particular port, which can then be analyzed by a tool that retrieves the stream of profiling information.

Even though it's low-overhead and won't add much burden during profiling, the profiler can still generate a very large amount of information if enabled for too long a test (it's tracking every tag in every request while enabled). Profiling tools aren't really meant to be used to analyze full bore load tests. Again, I was just using a small sample generating multiple requests against several pages running for about 30 seconds.

The current version of the profiler is a web-based interface (HTML, generated from CFML), but a Flash-based version could be a powerful adaptation and is under consideration.

Viewing the Profile of All Requests
With the load test completed (or indeed even while it's running), I opened the web-based interface to view the requests currently being profiled. See Figure 1. The "get latest profiles" button caused the profiler to gather all the current profiling information being generated by the latest set of requests.

The profiler collects all the information since the BlueDragon engine has started, but I can clear the profiled requests at any time before running another set of tests, in order to focus only on those most recently run requests. I'll be doing this later, after performing some code changes based on the information presented from this first load test.

Since profiling may be generated for many requests (even hundreds in my small test), the interface provides for scrolling to show just 10 requests at a time. The list of requests can also be sorted by any of the available columns, and I have chosen to sort it by the "Render Time" column, listing the requests by total execution time per request.

Further, you'll notice that many of them are highlighted in yellow. That's not something I added to the screenshots for this article but rather it's what the profiler will do for you to help isolate the most troubling requests, based on a "filter" field available on the display. I've entered a value of 100 (milliseconds), but you can set it to whatever value you prefer depending on the kind of data shown in your profile display.

We can see that all the requests shown as being of greatest duration are for the page /cfdocs/exampleapps/personneldirectory/results.cfm. The load test ran many other requests, but these are the ones taking the most time, so that's where I can start to focus my tuning attention.

To be fair, the kind of information shown in Figure 1, viewing total time per request, can be obtained from other tools, including simple web server log analysis tools. Indeed, yet another tool offering this sort of aggregated CFML page request information (for both CFMX and BlueDragon/J2EE) is the excellent SeeFusion tool, available at http://seefusion.com.

Even so, there is at least one hint of the greater power of the profiler in that the display also shows the number of tags run within the request. Clearly that's not reported by a web server log analysis tool (nor even by SeeFusion, though it has great value as an adjunct to the profiler which I'll discuss later).

Drilling Down to View All Tags In The Request
At this point, most CFML developers would at least be delighted to be able to take this information and focus on the one page that's showing to cause the most execution time. They would open the code and start eye-balling to see what's up, but the BlueDragon Profiler can do much more for you!

You can click on a given request, and as Figure 2 shows it will drill down and view details for that request, displaying several interesting kinds of detail that CFML developers have simply never seen. First, notice that it displays all the tags that were executed in the request, and further it shows the number of times they were executed, how long they took in aggregate, as well as the average time spent per execution of that tag. Very cool!

Note as well that this information is across all templates executed within the request, meaning included files and CFML custom tags, whose names are all shown at the bottom of the display. That portion of the screen also shows how many times each of those files was used in the request as well as the number of tags in each file and the total time spent in each file.

More Stories By Charlie Arehart

A veteran ColdFusion developer since 1997, Charlie Arehart is a long-time contributor to the community and a recognized Adobe Community Expert. He's a certified Advanced CF Developer and Instructor for CF 4/5/6/7 and served as tech editor of CFDJ until 2003. Now an independent contractor (carehart.org) living in Alpharetta, GA, Charlie provides high-level troubleshooting/tuning assistance and training/mentoring for CF teams. He helps run the Online ColdFusion Meetup (coldfusionmeetup.com, an online CF user group), is a contributor to the CF8 WACK books by Ben Forta, and is frequently invited to speak at developer conferences and user groups worldwide.

Comments (0)

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.


@ThingsExpo Stories
"When we talk about cloud without compromise what we're talking about is that when people think about 'I need the flexibility of the cloud' - it's the ability to create applications and run them in a cloud environment that's far more flexible,” explained Matthew Finnie, CTO of Interoute, in this SYS-CON.tv interview at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
The Internet giants are fully embracing AI. All the services they offer to their customers are aimed at drawing a map of the world with the data they get. The AIs from these companies are used to build disruptive approaches that cannot be used by established enterprises, which are threatened by these disruptions. However, most leaders underestimate the effect this will have on their businesses. In his session at 21st Cloud Expo, Rene Buest, Director Market Research & Technology Evangelism at Ara...
No hype cycles or predictions of zillions of things here. IoT is big. You get it. You know your business and have great ideas for a business transformation strategy. What comes next? Time to make it happen. In his session at @ThingsExpo, Jay Mason, Associate Partner at M&S Consulting, presented a step-by-step plan to develop your technology implementation strategy. He discussed the evaluation of communication standards and IoT messaging protocols, data analytics considerations, edge-to-cloud tec...
New competitors, disruptive technologies, and growing expectations are pushing every business to both adopt and deliver new digital services. This ‘Digital Transformation’ demands rapid delivery and continuous iteration of new competitive services via multiple channels, which in turn demands new service delivery techniques – including DevOps. In this power panel at @DevOpsSummit 20th Cloud Expo, moderated by DevOps Conference Co-Chair Andi Mann, panelists examined how DevOps helps to meet the de...
When growing capacity and power in the data center, the architectural trade-offs between server scale-up vs. scale-out continue to be debated. Both approaches are valid: scale-out adds multiple, smaller servers running in a distributed computing model, while scale-up adds fewer, more powerful servers that are capable of running larger workloads. It’s worth noting that there are additional, unique advantages that scale-up architectures offer. One big advantage is large memory and compute capacity...
With major technology companies and startups seriously embracing Cloud strategies, now is the perfect time to attend 21st Cloud Expo October 31 - November 2, 2017, at the Santa Clara Convention Center, CA, and June 12-14, 2018, at the Javits Center in New York City, NY, and learn what is going on, contribute to the discussions, and ensure that your enterprise is on the right path to Digital Transformation.
Amazon started as an online bookseller 20 years ago. Since then, it has evolved into a technology juggernaut that has disrupted multiple markets and industries and touches many aspects of our lives. It is a relentless technology and business model innovator driving disruption throughout numerous ecosystems. Amazon’s AWS revenues alone are approaching $16B a year making it one of the largest IT companies in the world. With dominant offerings in Cloud, IoT, eCommerce, Big Data, AI, Digital Assista...
Artificial intelligence, machine learning, neural networks. We’re in the midst of a wave of excitement around AI such as hasn’t been seen for a few decades. But those previous periods of inflated expectations led to troughs of disappointment. Will this time be different? Most likely. Applications of AI such as predictive analytics are already decreasing costs and improving reliability of industrial machinery. Furthermore, the funding and research going into AI now comes from a wide range of com...
Internet of @ThingsExpo, taking place October 31 - November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA, is co-located with 21st Cloud Expo and will feature technical sessions from a rock star conference faculty and the leading industry players in the world. The Internet of Things (IoT) is the most profound change in personal and enterprise IT since the creation of the Worldwide Web more than 20 years ago. All major researchers estimate there will be tens of billions devic...
We build IoT infrastructure products - when you have to integrate different devices, different systems and cloud you have to build an application to do that but we eliminate the need to build an application. Our products can integrate any device, any system, any cloud regardless of protocol," explained Peter Jung, Chief Product Officer at Pulzze Systems, in this SYS-CON.tv interview at @ThingsExpo, held November 1-3, 2016, at the Santa Clara Convention Center in Santa Clara, CA
SYS-CON Events announced today that Ayehu will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on October 31 - November 2, 2017 at the Santa Clara Convention Center in Santa Clara California. Ayehu provides IT Process Automation & Orchestration solutions for IT and Security professionals to identify and resolve critical incidents and enable rapid containment, eradication, and recovery from cyber security breaches. Ayehu provides customers greater control over IT infras...
SYS-CON Events announced today that MobiDev, a client-oriented software development company, will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place October 31-November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. MobiDev is a software company that develops and delivers turn-key mobile apps, websites, web services, and complex software systems for startups and enterprises. Since 2009 it has grown from a small group of passionate engineers and business...
SYS-CON Events announced today that GrapeUp, the leading provider of rapid product development at the speed of business, will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place October 31-November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Grape Up is a software company, specialized in cloud native application development and professional services related to Cloud Foundry PaaS. With five expert teams that operate in various sectors of the market acr...
SYS-CON Events announced today that Enzu will exhibit at SYS-CON's 21st Int\ernational Cloud Expo®, which will take place October 31-November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Enzu’s mission is to be the leading provider of enterprise cloud solutions worldwide. Enzu enables online businesses to use its IT infrastructure to their competitive advantage. By offering a suite of proven hosting and management services, Enzu wants companies to focus on the core of their ...
SYS-CON Events announced today that Cloud Academy named "Bronze Sponsor" of 21st International Cloud Expo which will take place October 31 - November 2, 2017 at the Santa Clara Convention Center in Santa Clara, CA. Cloud Academy is the industry’s most innovative, vendor-neutral cloud technology training platform. Cloud Academy provides continuous learning solutions for individuals and enterprise teams for Amazon Web Services, Microsoft Azure, Google Cloud Platform, and the most popular cloud com...
SYS-CON Events announced today that IBM has been named “Diamond Sponsor” of SYS-CON's 21st Cloud Expo, which will take place on October 31 through November 2nd 2017 at the Santa Clara Convention Center in Santa Clara, California.
In his session at Cloud Expo, Alan Winters, an entertainment executive/TV producer turned serial entrepreneur, presented a success story of an entrepreneur who has both suffered through and benefited from offshore development across multiple businesses: The smart choice, or how to select the right offshore development partner Warning signs, or how to minimize chances of making the wrong choice Collaboration, or how to establish the most effective work processes Budget control, or how to ma...
SYS-CON Events announced today that CA Technologies has been named "Platinum Sponsor" of SYS-CON's 21st International Cloud Expo®, which will take place October 31-November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. CA Technologies helps customers succeed in a future where every business - from apparel to energy - is being rewritten by software. From planning to development to management to security, CA creates software that fuels transformation for companies in the applic...
Multiple data types are pouring into IoT deployments. Data is coming in small packages as well as enormous files and data streams of many sizes. Widespread use of mobile devices adds to the total. In this power panel at @ThingsExpo, moderated by Conference Chair Roger Strukhoff, panelists looked at the tools and environments that are being put to use in IoT deployments, as well as the team skills a modern enterprise IT shop needs to keep things running, get a handle on all this data, and deliver...
In his session at @ThingsExpo, Eric Lachapelle, CEO of the Professional Evaluation and Certification Board (PECB), provided an overview of various initiatives to certify the security of connected devices and future trends in ensuring public trust of IoT. Eric Lachapelle is the Chief Executive Officer of the Professional Evaluation and Certification Board (PECB), an international certification body. His role is to help companies and individuals to achieve professional, accredited and worldwide re...