Developer Support

Advocacy and Innovation

Gathering real-time Perfmon Counters in a cluster

Performance (aka. Perfmon) Counters are critical to understanding the health of and diagnosing issues on Windows. In recent performance and scalability testing of a solution built on top of Azure Service Fabric, we collected Perfmon Counters across 15 VMs and sent them to Log Analytics. This was very helpful; however, there were times when we wanted them to be real time.

Performance traps of ref locals and ref returns in C#

The C# language from the very first version supported passing arguments by value or by reference. But before C# 7 the C# compiler supported only one way of returning a value from a method (or a property) - returning by value. This has been changed in C# 7 with two new features: ref returns and ref locals. But unlike other features that were...

The performance characteristics of async methods in C#

The async series In the last two blog posts we've covered the internals of async methods in C# and then we looked at the extensibility points the C# compiler provides to adjust the behavior of async methods. Today we're going to explore the performance characteristics of async methods. As you should already know from ...

A common execution path optimization

Today I want to talk about one interesting optimization pattern that you may face in framework code or in high-performance libraries. The idea is simple: suppose you have a commonly used method that has two execution paths – one is very common and simple, and the second one takes longer to execute, has more steps but happens not that ...