Endjin - Home


High-performance C#: a test pattern for ref structs

by Ian Griffiths

C# 7.2 introduce ref structs, a new kind of type (Span is a ref struct) designed to support certain high performance scenarios. There are constraints around their use, and when writing unit tests for our Ais.Net parser, this caused some challenges. This blog describes the technique we used to work around the constraints.

There are hidden pitfalls with dependency injection, particularly when managing the lifetime of scoped components. What is safe? And are there other approaches we can take to managing scoped object lifetimes?

Being able to construct DAX queries dynamically in C# means the possibilities are endless in terms of integrating Azure Analysis Services queries into your custom applications, and with the code samples in this post, you have everything you need to get started.

We worked on a project recently which required us to build a highly performant system for processing vast quantities of messages in real time. We had made the decision to run this processing using Azure Functions with C#. This post runs through some of the techniques we used for writing highly performant, low allocation code, including data streaming, list preallocation and the relatively new C# feature: Span.

This blog is part of a series around design patterns. This post focuses on the composite pattern. The composite pattern is often used in situations where you want to me able to treat groups and individuals in the same way during processing.

This is the second blog in a series around design patterns. This post focuses on the builder pattern. The builder pattern is used when there is complex set up involved in creating an object. Like the other creational patterns, it also separates out the construction of an object from the object’s use.

This is the first blog in a series about design patterns. This blog focuses on the differences between the factory method and abstract factory patterns. The factory method is a method which takes the creation of objects and moves it out of the main body of the code. An abstract factory is similar to the factory method, but instead of a method it is an object in its own right.

At endjin we’ve done quite a lot of work around reactive data processing. This post is a great introduction to the main concepts in reactive programming. It runs through the main classes in Rx.NET and provides an easy-to-follow explanation of this powerful (and somewhat complex) area of .NET.

Garbage collection is the process in .NET of cleaning up unused memory. Here is a great post which explains how it works under the covers. If you have ever wanted to get an understanding of exactly what is going on behind the scenes when you write C# code, then this is the post for you!