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
With 10 simultaneous tracks, keynotes, general sessions and targeted breakout classes, Cloud Expo and @ThingsExpo are two of the most important technology events of the year. Since its launch over eight years ago, Cloud Expo and @ThingsExpo have presented a rock star faculty as well as showcased hundreds of sponsors and exhibitors! In this blog post, I provide 7 tips on how, as part of our world-class faculty, you can deliver one of the most popular sessions at our events. But before reading the...
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...
In his session at 21st Cloud Expo, Carl J. Levine, Senior Technical Evangelist for NS1, will objectively discuss how DNS is used to solve Digital Transformation challenges in large SaaS applications, CDNs, AdTech platforms, and other demanding use cases. Carl J. Levine is the Senior Technical Evangelist for NS1. A veteran of the Internet Infrastructure space, he has over a decade of experience with startups, networking protocols and Internet infrastructure, combined with the unique ability to it...
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...
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...
From 2013, NTT Communications has been providing cPaaS service, SkyWay. Its customer’s expectations for leveraging WebRTC technology are not only typical real-time communication use cases such as Web conference, remote education, but also IoT use cases such as remote camera monitoring, smart-glass, and robotic. Because of this, NTT Communications has numerous IoT business use-cases that its customers are developing on top of PaaS. WebRTC will lead IoT businesses to be more innovative and address...
In his opening keynote at 20th Cloud Expo, Michael Maximilien, Research Scientist, Architect, and Engineer at IBM, discussed the full potential of the cloud and social data requires artificial intelligence. By mixing Cloud Foundry and the rich set of Watson services, IBM's Bluemix is the best cloud operating system for enterprises today, providing rapid development and deployment of applications that can take advantage of the rich catalog of Watson services to help drive insights from the vast t...
SYS-CON Events announced today that Elastifile will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Elastifile Cloud File System (ECFS) is software-defined data infrastructure designed for seamless and efficient management of dynamic workloads across heterogeneous environments. Elastifile provides the architecture needed to optimize your hybrid cloud environment, by facilitating efficient...
Recently, IoT seems emerging as a solution vehicle for data analytics on real-world scenarios from setting a room temperature setting to predicting a component failure of an aircraft. Compared with developing an application or deploying a cloud service, is an IoT solution unique? If so, how? How does a typical IoT solution architecture consist? And what are the essential components and how are they relevant to each other? How does the security play out? What are the best practices in formulating...
In his session at @ThingsExpo, Arvind Radhakrishnen discussed how IoT offers new business models in banking and financial services organizations with the capability to revolutionize products, payments, channels, business processes and asset management built on strong architectural foundation. The following topics were covered: How IoT stands to impact various business parameters including customer experience, cost and risk management within BFS organizations.
SYS-CON Events announced today that Golden Gate University will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Since 1901, non-profit Golden Gate University (GGU) has been helping adults achieve their professional goals by providing high quality, practice-based undergraduate and graduate educational programs in law, taxation, business and related professions. Many of its courses are taug...
WebRTC is great technology to build your own communication tools. It will be even more exciting experience it with advanced devices, such as a 360 Camera, 360 microphone, and a depth sensor camera. In his session at @ThingsExpo, Masashi Ganeko, a manager at INFOCOM Corporation, will introduce two experimental projects from his team and what they learned from them. "Shotoku Tamago" uses the robot audition software HARK to track speakers in 360 video of a remote party. "Virtual Teleport" uses a...
When shopping for a new data processing platform for IoT solutions, many development teams want to be able to test-drive options before making a choice. Yet when evaluating an IoT solution, it’s simply not feasible to do so at scale with physical devices. Building a sensor simulator is the next best choice; however, generating a realistic simulation at very high TPS with ease of configurability is a formidable challenge. When dealing with multiple application or transport protocols, you would be...
SYS-CON Events announced today that DXWorldExpo has been named “Global Sponsor” of SYS-CON's 21st International Cloud Expo, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Digital Transformation is the key issue driving the global enterprise IT business. Digital Transformation is most prominent among Global 2000 enterprises and government institutions.
21st International Cloud Expo, taking place October 31 - November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA, will feature technical sessions from a rock star conference faculty and the leading industry players in the world. Cloud computing is now being embraced by a majority of enterprises of all sizes. Yesterday's debate about public vs. private has transformed into the reality of hybrid cloud: a recent survey shows that 74% of enterprises have a hybrid cloud strategy. Me...
SYS-CON Events announced today that Secure Channels, a cybersecurity firm, will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Secure Channels, Inc. offers several products and solutions to its many clients, helping them protect critical data from being compromised and access to computer networks from the unauthorized. The company develops comprehensive data encryption security strategie...
In his session at @ThingsExpo, Sudarshan Krishnamurthi, a Senior Manager, Business Strategy, at Cisco Systems, discussed how IT and operational technology (OT) work together, as opposed to being in separate siloes as once was traditional. Attendees learned how to fully leverage the power of IoT in their organization by bringing the two sides together and bridging the communication gap. He also looked at what good leadership must entail in order to accomplish this, and how IT managers can be the ...
Recently, WebRTC has a lot of eyes from market. The use cases of WebRTC are expanding - video chat, online education, online health care etc. Not only for human-to-human communication, but also IoT use cases such as machine to human use cases can be seen recently. One of the typical use-case is remote camera monitoring. With WebRTC, people can have interoperability and flexibility for deploying monitoring service. However, the benefit of WebRTC for IoT is not only its convenience and interopera...
There is only one world-class Cloud event on earth, and that is Cloud Expo – which returns to Silicon Valley for the 21st Cloud Expo at the Santa Clara Convention Center, October 31 - November 2, 2017. Every Global 2000 enterprise in the world is now integrating cloud computing in some form into its IT development and operations. Midsize and small businesses are also migrating to the cloud in increasing numbers. Companies are each developing their unique mix of cloud technologies and service...
When shopping for a new data processing platform for IoT solutions, many development teams want to be able to test-drive options before making a choice. Yet when evaluating an IoT solution, it’s simply not feasible to do so at scale with physical devices. Building a sensor simulator is the next best choice; however, generating a realistic simulation at very high TPS with ease of configurability is a formidable challenge. When dealing with multiple application or transport protocols, you would be...