Archive for the Performance category

Vaughan

When to consider using ValueTask over Task with async code

.NET Core, BenchmarkDotNet, Benchmarking, Measuring, Performance

As of .NET Core 2.0, you can use ValueTask and ValueTask as return types for your async methods. Its important to understand when and if you should use these instead of a Task and what the trade-offs are if you decide to use it. I would say that if you aren’t measuring the performance of […]

Read more
Vaughan

Counting sheep with BenchmarkDotNet

.NET Core, BenchmarkDotNet, Benchmarking, Measuring, Performance

When trying to improve the performance of your code, the first thing you need to do is measure. If you don’t measure then you won’t know if your changes are actually improving performance. In most cases, there is a trade-off between readability and performance. Often better performing code is more complex and harder to maintain. […]

Read more
Vaughan

Why concurrency with async beats parallelism for scalability

.NET Core, Measuring, MultiThreading, Performance

Two terms that are often used interchangeably are concurrency and parallelism. It doesn’t help that in English, doing something concurrently means that you are doing more than one thing at a time. In software its a little more complicated. A good explanation on the difference that I have read before is as follows: Concurrency You […]

Read more
Vaughan

Measuring .Net Core: 2. Using dotnet-counters

.NET Core, Dotnet Tools, Measuring, Performance

This is the second in a series of posts covering measuring a .Net Core application. If you want to try follow the code then you can have a look at this repo: Blog-Diagnostics. This is the plan for the series. I will update this with links as it evolves. Setting up local diagnostics tools Using […]

Read more

BMC logoBuy me a coffee