liveBook · Manning

Wall-clock profiling

As explained in Fast by Default

Wall-clock profiling measures elapsed time regardless of whether a thread is executing on a CPU or waiting for another resource.

Wall-clock profiling measures elapsed time while a thread runs or waits. It exposes delays hidden from CPU profiles, including lock contention, database waits, and external service calls. section 7.2.3

Use it when endpoint latency exceeds what CPU activity explains:

  • Profile CPU time first and inspect the flame graph. section 7.2.3
  • Switch to wall-clock mode when the profile looks clean but the endpoint remains slow. section 7.2.3
  • Compare the result with request timing logs to locate the hidden waiting phase. section 7.2.3

A slow API with a clean flame graph

An endpoint may spend little CPU time while waiting on a lock, database connection, or external service. Wall-clock profiling makes that blocked interval visible and directs investigation toward the actual latency source. section 7.2.3

How Fast by Default covers it

How deep it goes
Distinguishes CPU work from waiting and recommends switching modes or checking timing logs, but omits profiler configuration details.
Examples
Uses slow API endpoints waiting on locks, database connections, or external service calls.
What it assumes
Assumes familiarity with CPU profiles and endpoint timing, while distinguishing processor work from resource waiting.
What you can do after
Diagnose/debug with it by exposing off-CPU delays when a CPU profile appears clean.
How it connects
Connects CPU profiling with lock contention, blocking calls, database access, external services, and request timing logs.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Fast by Default. The section links point to the parts of the book it draws on.