
Writing
High Performance Logging and Custom Objects
An application logging adapter can accept a DTO and expose its fields as structured state. ILogger.Log<TState> separates that context from the formatted message.

Topic
Obtaining storage for values, objects and working data. Allocation size, frequency and lifetime affect copying, memory use and the work required to reclaim storage.
4 pages

Writing
An application logging adapter can accept a DTO and expose its fields as structured state. ILogger.Log<TState> separates that context from the formatted message.

Writing
Repeated work can hide inside a short LINQ query. A customer-filtering benchmark separates string conversions, lookup choices, iteration and changed behavior.

Writing
A benchmark tests whether a change improves the same operation. BenchmarkDotNet makes input choice, setup, timing and allocation costs visible for .NET code.

Writing
.NET allocation costs follow what gets stored and copied. Structs, classes, arrays and strings explain object layout, references and garbage collection.