When an event is slow, know where the time went — not just that the overall handler took 500ms, but which function inside it was responsible, and which functions that function called.
Most driver events are a tree of function calls: an event handler calls a few helpers, those call C4 API methods, some branches are fast, others aren't. Without profiling, that tree is invisible — all you see is a single duration for the outer handler.
Method-level profiling captures the full call tree for an individual event. You can view it as a flame graph (the hot paths stand out visually), as a waterfall chart (good for understanding when in the event each call happened), or as a collapsible call tree (good for reading the code path, especially when exploring unfamiliar code).
Because capturing that much detail has overhead, profiling is opt-in. You turn it on when investigating a specific problem or when you want to understand an event's shape, and turn it off when you're done.
What we're thinking:
  • Toggle profiling on for the next N events, or for a whole session
  • Flame graph, waterfall, and call tree views of a single event
  • Filter to profile only specific event types (e.g. only ExecuteCommand)
  • C4 API calls included in the tree so you can see where API time is spent
Help us shape this:
  • When you hit a slow event today, what do you do to figure out why?
  • Which view would you reach for first — flame graph, waterfall, or call tree?
  • Would on-demand profiling be enough, or would a lightweight always-on mode (top-level calls only) be more useful?