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

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 make your database query disappear. Learn how RequestAborted flows through ASP.NET Core, EF Core, and HttpClient, where cancellation should stop, and how to test it.

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 thinking about performance entirely. Here's Knuth's real argument, and why finding the 3% requires an instinct you have to train.

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. Here's 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

In .NET, correct and algorithmically optimal code can still drag, because every needless allocation feeds the GC. Here's 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. Here's where it bites and how to make complexity 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.