Preview .NET with BenchmarkDotnet

In a previous post I explored how someone can setup a custom .NET SDK and Runtime for development. It consists of a script downloads the .NET runtime to a custom folder, another script that sets up environment variables to use the given .NET version with Visual Studio and a global.json / nuget.config for build time dependencies with Visual Studio and the .NET CLI.

In this post I evolve the previous setup:

  • Install and use an alpha release of .NET 10 Runtime with .NET 9 SDK.

  • Setup BenchmarkDotNet performance measurements to use .NET 10

Update the runtime to .NET 10

Find out more


Setup Local Preview .NET

In this blog post I will detail how to setup early preview versions of .NET for development. My findings apply for .NET 9, but the methods should be applicable in general to most versions of .NET (considering version specific details).

While a preview version of .NET can be downloaded at any time from the dotnet website, installing the forthcoming preview version requires somewhat more investment.

The findings of this post are based on ASP.NET Core, which uses a similar, but more complex approach in its restore.cmd command. This blog post will focus on the key components to have the latest SDK or a custom runtime available.

The preview versions of .NET can heavily change. Features may get added, removed, changed, or their performance might significantly improve. It is always suggested to choose and use an LTS or STS release for production applications. However, in certain cases a developer might want to test the latest preview features, in which case the methods described in this blog post will help.

Find out more


Vectorized Subset Sum

In this series I am implementing Dynamic Programming Katas with vectorized solutions.

The first post explored the Vectorized Longest Increasing Subsequence problem, and in the second post I dived into the Checkerboard problem.

In this post I will explore a version of the Subset sum problem. I will not focus on the most efficient algorithm or implementation for this problem. Instead, I will present the most common approach to solve the problem using Dynamic Programming and then present a vectorized version of the algorithm.

Introduction

Find out more


Alternate Dictionary Lookup

This blog post is based on .NET 9 Preview 6. Bits and pieces of the underlying runtime will change for the final release.

In .NET9 a new extension method on Dictionary type allows creating an alternate lookup type for the dictionary. This is particularly useful for dictionaries that have a string key, as the alternate lookup allows an alternate type to be used for lookups in the dictionary, for example ReadOnlySpan<char>.

Most sets and dictionaries (immutable, frozen, etc.) support this new API. However, not all dictionaries support the alternate lookup equally. Some only support certain types as alternates. Hence, there is a second extension method TryGetAlternateLookup, which does not throw when the requested alternate type is not supported.

How to lookup an alternate key?

Find out more


Vectorized Checkerboard

In this series I am implementing Dynamic Programming Katas with vectorized implementations.

The first post explored the Vectorized Longest Increasing Subsequence problem, and in this post I will dive into the Checkerboard problem.

Introduction

Consider a checkerboard with n*n squares and a cost function c(i, j) which returns a cost associated with the indexes of (i,j). The checker starts in the first row. We would like to know the shortest path (the sum of the minimum costs at each visited row) to get to the last row. The checker could move only diagonally left forward, diagonally right forward, or straight forward. That is, a checker on (1,3) can move to (2,2), (2,3) or (2,4).

Find out more