site image
Andrew Lock avatar

Andrew Lock

C#
  1. Loading...
  2. Sponsored by Dometrain Courses—Get 30% off Dometrain Pro with code ANDREW30 and access the best courses for .NET Developers

    30% off with code ANDREW30 on Dometrain Pro
  3. ASP.NET Core in Action, Third Edition

    My new book ASP.NET Core in Action, Third Edition is available now! It supports .NET 7.0, and is available as an eBook or paperback.

  4. Banner image for Counting the leading zeroes in a binary number with C#

    Counting the leading zeroes in a binary number with C#

    In this post I describe an algorithm to count the number of leading zeroes in a ulong, study how it works, and benchmark it against alternatives.…

     in  C#
  5. Banner image for Working with System.Random and threads safely in .NET Core and .NET Framework

    Working with System.Random and threads safely in .NET Core and .NET Framework

    In this post I look at some of the ways you can misuse System.Random, comparing .NET Framework, NET Core, and .NET 6 implementations.…

     in  C#
  6. Banner image for Creating a source generator

    Creating a source generator

    In this series I describe how to create a source generator, cover issues such as testing the generator, and creating a NuGet package.…

     in  .NET CoreC#Source Generators
  7. Banner image for ValueStringBuilder: a stack-based string-builder

    ValueStringBuilder: a stack-based string-builder

    A deep dive on StringBuilder - Part 6

    In this post I discuss the ValueStringBuilder type, used internally in .NET as a zero/low-allocation alternative to StringBuilder…

  8. Banner image for Reducing allocations by caching with StringBuilderCache

    Reducing allocations by caching with StringBuilderCache

    A deep dive on StringBuilder - Part 5

    In this post I look at the internal StringBuilderCache type, benchmark it against a StringBuilder, and walk through the code to show how it works.…

  9. Banner image for Inserting and removing characters

    Inserting and removing characters

    A deep dive on StringBuilder - Part 4

    In this post we look at the Insert() and Remove() functions, which can involve tricky manipulations of chunks in the middle of the linked list…

Andrew Lock | .Net Escapades
Want an email when
there's new posts?