.NET profiler for Windows Azure

Under modern managed runtimes, performance profiling comes in two flavors:

In last decade, the No1 breakthrough in the profiling arena was the introduction of sampling. Instead of intercepting every single method call, every single object allocation - introducing a 10x slowdown in the process - the profiler takes only sample at regular intervals.

Sampling decreases the accuracy in favor of gain in performance. In practice, sampling is not just a tradeoff, it’s a game changer.

Indeed, even a modest sampling rate - say 2 or 3% of your processing capacity - give you already incredibly precise execution profile. Hint: with a 2Ghz CPU, 1% already accounts for 10M cycles per second.

With sampling, it becomes possible to aggregate fine grained execution statistics in production conditions, or even in actual production leaving the profiler ON all the time.

In the .NET ecosystem, Microsoft has been offering for years a free (yet rudimentary) memory profiler - while 3rd party vendors were providing more advance tools, such as the excellent dotTrace by JetBrains.

Lately, I discovered that Microsoft had released a new free CPU Profiler for .NET along with Visual Studio 2008. Caution: while running this tool for the 1st time, I did get a Blue Screen of Death caused by an unsupported proc, problem was fixed through a Microsoft hotfix.

The MS profiler is rather crude, especially on UI part. Yet, its strong orientation toward command-line and CSV/XML exports makes it rather handy for continuous integration scenarios where the profiler is run behind unit tests (or batch execs) putting the system under performance stress.

Back to the cloudy part announced in the post title, I believe that profilers will soon be considered a must-have components for cloud computing. Indeed, with the cloud you end-up precisely charged for the resources you consume.  Thus, the performance gains obtained with a profiler have a very real and very measurable ROI.

Cloud computing is not cheap per se: if you really want cheap stuff, you can roll your own hardware and get a 90% discount. Cloud computing is low cost only if performance is kept under control: no need to be a performance hero, but poor performance - that could be tolerated in good ol‘days where the customer was paying for the hardware too - now impacts the SaaS vendor instead.

Forecasters expect the cloud computing market to top over dozens of billions: cost-killer technologies are bound to emerge in such a large market, and I expect profilers to be one of them.

Comparing the very marginal overhead of a sampling profiler to the significant savings that could be obtained by fine-tuning the precise hotspots of cloud apps, I expect cloud profilers to be used in the background for all apps in both testing AND production environments alike.

The strong orientation of Windows Azure toward .NET makes it one of the best cloud to introduce early on such a profiling layer on top of cloud apps.

I am actually toying with the idea of trying to run the MS profiler on Azure directly (you can run arbitrary executable files), however it may prove a bit difficult for the time being.