Presentation: PerfView: The Ultimate .NET Performance Tool

Track: Bare Knuckle Performance

Location: Whittle, 3rd flr.

Duration: 1:40pm - 2:30pm

Day of week: Wednesday

Level: Advanced

Share this on:

What You’ll Learn

  • Hear about PerfView, an open source tool for .NET performance diagnosis in production environments.

  • Learn how to use PerfView through examples.

Abstract

PerfView is a free, standalone, small-impact tool produced by the CLR team that helps in performance investigations. It offers several unique features for understanding large performance reports, such as sampling, pattern folding, differencing, and grouping. You can use it for ETW analysis on large-scale Windows servers as well as low-end client devices and phones -- and you can even use it as a general-purpose analysis tool for Linux performance traces. In this session we will use PerfView to systematically measure and improve CPU time, wall-clock time, and memory usage (yes, PerfView can solve memory leaks as well!).

Question: 

What's the primary focus of your talk?

Answer: 

I traditionally have been a Windows person. My first year as a developer was C++ on Windows. But at some point I became a performance diagnostic generalist. I do a mix of work that could be a Linux system, even embedded Linux, it could be .NET running on Windows, could be web applications, could be JVM. I don't deal with specific languages so much although I do still write code. I'm more interested in how the runtime works, in the interactions with the operating system, systems level stuff. That's where I find most interesting cases.

Question: 

Can you tell us a bit about the motivation for your talk?

Answer: 

A lot of Windows developers only have in their toolbox some very expensive and not really 'wieldy' performance diagnostic tools. You could maybe use them in the development environment while you're writing the code, maybe even in load testing but not so much in production. A lot of the Windows profilers and the .NET profilers slow you down a lot, and they have really complicated installations required or they are very invasive. There's a bunch of problems which make them irrelevant for production even if it's a controlled production environment, and even worse if it is partially under your control, like a PaaS cloud offering where you're not really just running arbitrary code on the target machine. And this is where PerfView comes in. It's an open source tool. It was originally developed inside Microsoft for their own use troubleshooting and diagnosing issues with the .NET runtime itself and with various applications they had. One of the first users was the Bing team, and they have used it extensively until this day. But now it's a comprehensive tool for doing all kinds of performance analysis on Windows. It has a strong .NET focus but you can use it for C++ applications as well. What’s more, you can put PerfView in a production environment and grab data and move it back and forth.

Question: 

How are you going to address the tool in your talk?

Answer: 

I've been doing .NET performance training for a while, so I have a huge collection of demos and labs which I’m going to use. Examples include a desktop application that has a non-responsive UI that we can troubleshoot using PerfView, a server application which is having trouble keeping up with requests because it's allocating a lot of memory and causing lots of garbage collection. I'll show how to set up continuous monitoring so that you can have something running in the background and collecting lightweight data all the time. When something suspicious happens, like a CPU spike or a particularly long request, then you automatically flush the events you collected so far, and you just keep recording them to memory so on disk you only get data that you want to analyze. There's about 5 or 6 examples like that that I'll be going through and showing the power of PerfView.

Question: 

What you want someone to be able to leave your talk with?

Answer: 

I just want them to be using PerfView in their day job. It's really almost the only option for production environments and for systems that are not entirely under your control. Even in development, it has a bunch of features like one thing we will be showing, the heap memory snapshots. Of course, you can take a heap snapshot of a process and analyze it with numerous other tools. But PerfView has its own system for collecting snapshots, which is a lot more compact, so you can generate snapshots of 50 GB heaps, which is really hard with almost any other tool. I just want people to know that this thing is available, it's widely tested, it's a Microsoft product on one hand but it's very rapidly evolving, so it's something that they should be using for a lot of performance problems they run into.

Speaker: Sasha Goldshtein

CTO of Sela Group, a Microsoft MVP and Regional Director

Sasha Goldshtein is the CTO of Sela Group, a Microsoft MVP and Regional Director, Pluralsight and O'Reilly author, and international consultant and trainer. Sasha is the author of two books and multiple online courses, and a prolific blogger. He is also an active open source contributor to projects focused on system diagnostics, performance monitoring, and tracing -- across multiple operating systems and runtimes. Sasha authored and delivered training courses on Linux performance optimization, event tracing, production debugging, mobile application development, and modern C++. Between his consulting engagements, Sasha speaks at international conferences world-wide.

Find Sasha Goldshtein at

Last Year's Tracks

Monday, 5 March

Tuesday, 6 March

Wednesday, 7 March