Уровень 0 · материалов: 4
В кластер входят документы, описывающие низкоуровневую оптимизацию ресурсов и выполнение кода в среде .NET, и не входят документы об оптимизации библиотек языка Python.
Общие признаки: управление памятью, повышение производительности, работа с типами данных в .NET, минимизация накладных расходов
Группа выше: Производительность и память в .NET
Смысл: The main idea is that standard .NET collections and high-level object abstractions introduce significant memory overhead that becomes prohibitive when dealing with millions of records. Achieving maximum memory efficiency requires using value types (structs), avoiding the 'string' type in favor of fixed byte buffers in unsafe blocks, and implementing custom data structures to control memory allocation and growth.
The author optimizes C# memory usage for 100 million records by replacing classes and standard dictionaries with unsafe fixed buffers and custom-built data structures to minimize overhead.
Смысл: The main idea is to educate C# developers on how to precisely control the memory layout of structures to ensure successful interoperability with unmanaged code, binary files, and external APIs, while explaining the trade-offs between safe and unsafe code.
A detailed technical guide on C# structure memory layout, marshalling, and serialization for interoperability with unmanaged APIs.
Смысл: The main idea is to replace expensive, repeated reflection calls in .NET with a caching mechanism (virtualization) using static generic classes and wrapper objects to significantly increase application performance.
The article demonstrates how to optimize .NET reflection performance by caching type metadata using the TypeOf<T> and RipeType patterns.
Смысл: The main idea is that .NET Expression Trees provide a powerful way to represent and generate code dynamically at run-time, offering a massive performance advantage over traditional Reflection for tasks like object instantiation and deserialization.
The article demonstrates how to use C# Expression Trees to replace slow Reflection with dynamically compiled code, significantly increasing execution speed for object creation.