Taking a closer look at the CompilerServices Unsafe approach to unsafe reference arithmetic over fixed statement in .NET. .NET has a garbage collector (GC) that automates memory management. This is incompatible with working with direct memory pointers, since the GC needs to track object usage and move objects around when required. You are of course … Read more
In a previous blog post I detailed how you can speed up array access in certain cases. This time I’m taking a look at what is happening when we access arrays in .Net, and digging into why multidimensional arrays are slow. First a quick refresher on array types. Array This is just a standard array. … Read more
In .Net memory access is safe by default. This means that every time you access an array item the index is checked against the length of the array. In this post I explore how you can speed up plain old array access 18%-34% by convincing the compiler it can skip some checks. I compile the … Read more
Automatically unlock encrypted volumes in QNAP via network using a BASH-script in a Cron-job. This script will log on, list locked drives and unlock them. Data stored on the disks are encrypted, and you need a key do access the disks. The key is kept in memory, so if power is lost the disks are … Read more
If you have used async/await, but feel some details are still a bit fuzzy then this may be for you. I thought I’d hop down into the rabbit hole and give some examples of how async/await actually works. Hopefully this will provide some understanding and get you further on your journey to become an expert. … Read more
PowerShell script to recursively recompress ZIP-files with higher compression. Note that Deflate64 isn’t strictly zip standard afaik, but it works for most zip applications.
Response cache is fine for simpler operations, but sometimes you need more fine grained control. System.Runtime.Caching.MemoryCache has builtin support for in-memory cache with expiry.
ASP.NET Core comes with built-in support for response caching. Unlike cache-control header that tells client/proxies how long to cache data, the response cache will cache output of an action.