Laszlo

Hello, I am Laszlo

Software-Engineer, .NET developer

Contact Me

Common ArrayPool Mistakes

In this post I review common mistakes I find (and sometimes make) when using ArrayPool<T> in .NET and C#. Examples target the .NET 10 runtime and the corresponding BCL.

ArrayPool<T> lets you rent arrays from a shared pool. It's typically used to obtain a temporary buffer for intermediate work before copying results to a final destination. When a method cannot update input data in place or requires a larger buffer for intermediate calculations, ArrayPool<T> is often beneficial: it avoids allocating a new array for every operation, reducing GC pressure and improving performance. The most common generic types used with ArrayPool are byte and char.

Typical usage involves three steps:

  • Rent an array from the pool.
  • Use the rented array for operations.
  • Return the array to the pool.

Find out more »


Deep dive into .NET 11 Performance Improvements #7

In this series, I explore some of the most interesting .NET 11 performance improvements described in Stephen Toub's blog post, Performance Improvements in .NET 11.

Each post focuses on one example from the original article while digging a little deeper into an additional aspect that was not covered there. The series covers the following topics:

  1. Allocation free numbers
  2. Virtual generic method calls
  3. Vector zero equality
  4. Guid creation on Linux
  5. JIT generating implicit-else assembly instructions
  6. Guid equality
  7. Current post: Copy-on-write locking strategy

Copy-on-write locking strategy

Find out more »


Deep dive into .NET 11 Performance Improvements #6

In this series, I explore some of the most interesting .NET 11 performance improvements described in Stephen Toub's blog post, Performance Improvements in .NET 11.

Each post focuses on one example from the original article while digging a little deeper into an additional aspect that was not covered there. The series covers the following topics:

  1. Allocation free numbers
  2. Virtual generic method calls
  3. Vector zero equality
  4. Guid creation on Linux
  5. JIT generating implicit-else assembly instructions
  6. Current post: Guid equality
  7. Copy-on-write locking strategy

Guid equality

Find out more »


Deep dive into .NET 11 Performance Improvements #5

In this series, I explore some of the most interesting .NET 11 performance improvements described in Stephen Toub's blog post, Performance Improvements in .NET 11.

Each post focuses on one example from the original article while digging a little deeper into an additional aspect that was not covered there. The series covers the following topics:

  1. Allocation free numbers
  2. Virtual generic method calls
  3. Vector zero equality
  4. Guid creation on Linux
  5. Current post: JIT generating implicit-else assembly instructions
  6. Guid equality
  7. Copy-on-write locking strategy

JIT generating implicit-else assembly instructions

Find out more »


Deep dive into .NET 11 Performance Improvements #4

In this series, I explore some of the most interesting .NET 11 performance improvements described in Stephen Toub's blog post, Performance Improvements in .NET 11.

Each post focuses on one example from the original article while digging a little deeper into an additional aspect that was not covered there. The series covers the following topics:

  1. Allocation free numbers
  2. Virtual generic method calls
  3. Vector zero equality
  4. Current post: Guid creation on Linux
  5. JIT generating implicit-else assembly instructions
  6. Guid equality
  7. Copy-on-write locking strategy

Guid creation on Linux

Find out more »