Skip to content
Katabench
Try free

Topic

.NET Performance

Practical C# performance work: async behavior, allocations, garbage collection, algorithms, and the measurements that expose bottlenecks.

8 min read

BenchmarkDotNet: measuring C# performance without fooling yourself

BenchmarkDotNet measures C# performance without the lies a Stopwatch tells: tiered JIT, dead-code elimination, and GC noise, plus how to read the results table.

Read article →
8 min read

C# String Concatenation Performance, Measured

Choose between +, interpolation, StringBuilder, and direct writes in modern C#. Fix repeated copying, then verify the result with allocation benchmarks.

Read article →
7 min read

CancellationToken in ASP.NET Core: stop doing work nobody wants

A disconnected client does not cancel your database query by itself. How RequestAborted flows through ASP.NET Core, EF Core, and HttpClient, and where it stops.

Read article →
8 min read

C# async await mistakes that pass code review

The C# async await mistakes that pass code review: async void, fire and forget tasks, missing CancellationToken plumbing, and blocking on .Result.

Read article →
8 min read

.NET garbage collection explained: what gen 0, 1, and 2 cost

.NET garbage collection explained: why most objects die young, what gen 0, 1, and 2 collections cost, and why the large object heap hurts latency.

Read article →
9 min read

Sync over Async: Diagnose .NET Thread Pool Starvation

Learn how sync over async causes .NET Thread Pool starvation, spot it with dotnet-counters, capture blocking stacks, and fix ASP.NET Core latency.

Read article →
7 min read

The LINQ query that ran twice: multiple enumeration and other deferred-execution traps

An IEnumerable isn't a list; it's a promise to do work later. Enumerate it twice and the work happens twice, including, with EF Core, the database query.

Read article →
6 min read

The premature optimization myth: what Knuth actually said

The most-abused quote in software lets developers dodge performance entirely. Knuth's real argument, and why finding the critical 3% takes a trained instinct.

Read article →
5 min read

Span<T>, Memory<T>, and stackalloc: when zero-allocation C# is worth it

Span<T> and stackalloc let you parse and slice without allocating, but they have real limits. When zero-allocation C# earns its keep and when it's overkill.

Read article →
6 min read

The allocation tax: why correct, O(n) C# can still be slow

Correct, algorithmically optimal .NET code can still drag, because every needless allocation feeds the GC. How to spot and cut allocation pressure in C#.

Read article →
6 min read

Big-O isn't interview trivia: where complexity actually bites in production

Big-O gets crammed for interviews and forgotten, but quadratic C# passes your tests and melts in prod. Where complexity bites and how to make it an instinct.

Read article →

Get new puzzles and .NET tips in your inbox

A short note when fresh kata land, plus the C# and performance tricks behind the grading. No spam, unsubscribe anytime.