Consider this code using Dictionary<TKey, TValue>: One might assume that the capacity (actually bucket count in this case) and memory usage will stabilize after repeatedly filling then clearing the collection. Unfortunately, this is not the case. Here is the output…
The battle of async methods
In a contest between async proper, Task.Run, and dedicated threads, who will win? Let’s gather some data points for a specific scenario and find out! Today’s benchmark will make use of a trivial single process WCF named pipes application using…
SSD and … sync I/O?
Walter Bright (via Andrei Alexandrescu) says, “Measuring gives you a leg up on experts who are too good to measure.” Today I’ll present some measurements that might be a bit surprising. In the old days of mechanical spinning disks, the…
Blogging on logging
Everyone loves a log. A trace log can provide insight into the goings-on of a running system. An audit log gives you an important “paper trail” tracking who did what and when. An error log might be an important aid…
Programmatic trace analysis with Tx
One of the benefits of ETW trace files is that they are fully structured. That is to say that they contain well-defined and strongly-typed data payloads, in contrast to raw text log files which only contain message strings. While this…
Decoding EventSource traces
In the previous post, I introduced an EventSource sample. If you run the sample app, the calculator client will continually try to connect to the service and perform random operations, tracing all the while. That’s nice, but how do you…
Better tracing with EventSource
Starting in .NET 4.5, managed code developers finally have a simple way to interact with ETW — System.Diagnostics.Tracing.EventSource. For a quick introduction, check out Vance Morrison’s inaugural blog post on EventSource and the also very helpful feature specification. While EventSource…
Real-time trace sessions with Tx
I recently showed an example of how to use TraceEvent to consume events from real-time trace sessions. Today I will show another way using the Tx.Windows NuGet package. Tx (LINQ to Logs and Traces) is an offshoot of the Rx…
Using PLA.dll to manage real-time trace sessions
As previously discussed, PLA.dll can help you collect perf counters, collect ETW trace logs, and create performance alerts. But what about real-time trace sessions? PLA.dll can manage those, too! A real-time trace session has some similarities to a collector set…
Using alerts to drive a load test
In the previous post, I promised to show a practical use case for performance alerts. Today I will make good on this promise and show a complete code sample on how to drive a load test using alerts. Imagine a…