profiling

2022-02-08 ยท 1 min read

Viewing perf results #

See WSL2 custom kernel > perf for how to collect and transform profile records with perf.

Use https://www.speedscope.app/ to view perf.data (after converting to text format with perf script).

Speedscope Views #

  1. Time Order

    Shows call stacks ordered by chronological order. Useful for seeing what is happening over time (e.g., first DB call, then request, then ...).

  2. Left Heavy a.k.a. Icicle View

    Shows identical stacks grouped together regardless of chronological order. The heaviest stack is always on the left. Basically flamegraph view but upside down (top stack on top).

  3. Sandwich

    Shows a table of all functions by total time spent. Clicking on a function will show you the "Left Heavy" view (but just for callers and callees of that function).