Tools and notes for C#/.NET optimization. Whether it's size or speed.
This is different from my dotnet-optimization-cheatsheet repo as that is mostly code tricks for performance, and this is mostly tools to help understand and make performance better.
Want to see how Microsoft does it? Check out their documentation for profiling dotnet/runtime.
Built-in code profiler for Visual Studio
.NET Decompiler
.NET tool to analyze size of Native AOT binaries
.NET language playground. See decompiled code on the fly in-browser
Powerful .NET library for benchmarking
While not an optimization tool, it's useful and easy to navigate the .NET repo - easier than GitHub.
See what methods are kept after AOT trimming
See what is inside a DLL (or other binary files)
dumpbin /EXPORTS C:\Windows\System32\msvcr120.dll > C:\Temp\dump.txt
Old school ILSpy
ildasm binary.dll
// or
ildasm binary.exe
Visual Studio extension to disassemble methods or classes. Similar to IlLSpy but in Visual Studio.
Getting an instance layout at runtime
Detects explicit and implicit allocations, boxings, closures, etc
GC Memory Visualiser
Announcement Tweet via Kevin Gosse
The results of dotnet/performance runs to check for regressions: Lab Reports
- nietras/Sep: The World's Fastest .NET CSV Parser
- noahfalk/1brc: 1 Billion Rows Challenge leader
- Cysharp/MemoryPack: Zero encoding extreme performance binary serializer for C# and Unity.