Runtime
news

11stories

Stories

CBOR · .NET
Reading partial binary data
CCC# Corner Aarav Patel 4 d ago

Reading CBOR Data Incrementally in .NET

C# Corner walks through reading CBOR data with the System.Formats.Cbor package, from a basic CborReader example to buffering partial network reads. It stresses separating incomplete input from malformed data, enforcing size limits and defining message boundaries. Useful for services that receive binary payloads from devices or APIs.

.NET 11 Native AOT
Domain model under AOT

Publishing a C# 15 Domain Model with Native AOT on .NET 11

NimblePros published its Tiles & Tokens sample, which relies on C# 15 unions and closed hierarchies, as a Native AOT binary on the .NET 11 RC1 SDK. The domain and serialization code produced no trimming or AOT warnings, and the native app ran correctly. The publish errors came from a reflection-based converter, an anonymous type and EF Core, which is a useful checklist for anyone planning a Native AOT app.

.NET 11
Async under the hood
HBHabr C# (ru) sproshchaev (OTUS) 5 d ago

Where Runtime Async in .NET 11 saves memory and where it doesn't

.NET 11 moves async method suspension from compiler-generated state machines to the runtime, with the JIT optimizing the boundaries between async methods. The author reruns the official benchmarks on RC2 and compares allocations, stack traces and assembly size. The gains are real in synchronous await chains and exception-heavy paths, but measurement setup changes the picture.

C# performans
When optimization pays off
PGDaniel Marbach (planetgeek) Daniel Marbach 6 d ago

When low-level .NET performance optimization is worth the complexity

Daniel Marbach draws on his pull requests to the Azure .NET SDK to explain when low-level performance work pays off. He argues that in library code, small allocation decisions multiply across every caller, yet added complexity carries a maintenance cost. The post offers a practical decision framework for library authors and application developers alike.

BenchmarkDotNet
Measure before optimizing
DVDEV Community: #csharp Henrique Mauri Oct 25

Measuring .NET performance with AI help using BenchmarkDotNet

The author optimizes a .NET reporting method step by step with BenchmarkDotNet, measuring each change separately. The final version drops from about 1.55 s to 11.9 ms and allocations fall from 33.1 MB to 0.23 MB. It is a useful case for anyone who wants to check AI-proposed optimizations with benchmarks and output comparisons before merging them.

.NET 11
Shell calls without deadlock

.NET 11 Process.RunAndCaptureText avoids the classic stdout/stderr deadlock

.NET 11 RC2 adds Process.RunAndCaptureText, which runs an external command, drains stdout and stderr together and returns both strings with the exit code. It removes the deadlock that the classic redirect-and-ReadToEnd pattern can hit on noisy tools. Anyone who shells out to git, ffmpeg or internal CLIs will want to know the new helpers and their timeout behavior.

NET 10 JSON
Read JSON from a pipe
ELelmah.io Blog Ali Hamza Ansari Oct 20

Reading large JSON with PipeReader in .NET 10 System.Text.Json

Ali Hamza Ansari compares the PipeReader overload that .NET 10 adds to System.Text.Json with reading the same large JSON payload from a Stream. He measures execution time, allocated memory and GC collection counts on a file with one million records. The results matter if your high-traffic endpoints deserialize big request bodies.

.NET 10 Runtime
Text search with SIMD
DVDEV Community: #csharp Pedro Sakuma Travi Oct 19

How ReadOnlySpan<char>.IndexOf finds a substring with SIMD

This article walks through how the .NET 10 runtime's ReadOnlySpan<char>.IndexOf finds a substring using SIMD vector instructions. The author compares it with a naive loop in a BenchmarkDotNet run and explains where the speed difference comes from. It is a useful deep dive for developers who care about string search performance.

Feedback

Found a bug or have an idea? Your message lands straight in my inbox.

Type of message