Previous: Interactive Sessions, Up: Applications


3.4 Profiler

Distel supports profiling function calls via the OTP fprof application. This is a very convenient profiler, in that it doesn't require any special compiler options or initialisation – you can use it whenever you want.

C-c C-d p
Prompt for an Erlang expression, evaluate it with profiling, and then summarise the results. (fprof)
C-c C-d P
Load and display prerecorded profiler data, from a file created by fprof:analyse/1. (fprof-analyse)

After an expression is profiled, the results are popped up in “profiler results” buffer. The buffer contains one line to describe each function that was called, with the following columns:

Calls
The total number of times the function was called.
ACC
The total time (ms) spent in the function, including its callees.
Own
The total time (ms) spent by the function itself, excluding time spent in its callees.

Furthermore, pressing RET on a summary line in the results buffer will pop up another buffer showing more information about the function: how much time it spent on behalf of each of its callers, and how much time it spent in each of its subfunctions.