How to easily measure CPU performance and allocation patterns
summary
Shows how to build small C# profilers that use TraceEvent/ETW and EventPipe to get allocation and CPU samples, demonstrating allocation-tick vs GC sample (tick gives type name but not size; GC sample gives exact counts and sizes but requires starting before the process), capturing stacks via TraceEvent/TraceLog and mapping JIT/native frames, using kernel profile for millisecond CPU sampling, and a Linux flow with perf + perfmap and perf script to produce files openable in PerfView. Demos work end‑to‑end though live demos suffer environment hiccups.
AI-written summary · about
