From 43c4a54a25e83a33a8383b7a96af20ecd14f10de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Mon, 24 Oct 2011 13:57:40 +0200 Subject: otp: Update profiling doc with eprof --- system/doc/efficiency_guide/profiling.xml | 57 ++++++++++++++++++++----------- 1 file changed, 37 insertions(+), 20 deletions(-) (limited to 'system/doc/efficiency_guide/profiling.xml') diff --git a/system/doc/efficiency_guide/profiling.xml b/system/doc/efficiency_guide/profiling.xml index 13165a0ede..65ba4b3369 100644 --- a/system/doc/efficiency_guide/profiling.xml +++ b/system/doc/efficiency_guide/profiling.xml @@ -40,9 +40,13 @@

Erlang/OTP contains several tools to help finding bottlenecks.

-

fprof and eprof provide the most detailed information - about where the time is spent, but they significantly slow downs the - programs they profile.

+

fprof provide the most detailed information + about where the time is spent, but it significantly slows down the + program it profiles.

+ +

eprof provides time information of each function used + in the program. No callgraph is produced but eprof has + considerable less impact on the program profiled.

If the program is too big to be profiled by fprof or eprof, cover and cprof could be used to locate parts of the @@ -50,7 +54,7 @@ eprof.

cover provides execution counts per line per process, - with less overhead than fprof/eprof. Execution counts can + with less overhead than fprof. Execution counts can with some caution be used to locate potential performance bottlenecks. The most lightweight tool is cprof, but it only provides execution counts on a function basis (for all processes, not per process).

@@ -102,35 +106,45 @@
fprof -

fprof measures the execution time for each function, +

+ fprof measures the execution time for each function, both own time i.e how much time a function has used for its own execution, and accumulated time i.e. including called functions. The values are displayed per process. You also get to know how many times each function has been called. fprof is based on trace to file in order to minimize runtime performance impact. Using fprof is just a - matter of calling a few library functions, see fprof manual - page under the application tools.

-

fprof was introduced in version R8 of Erlang/OTP. Its - predecessor eprof that is based on the Erlang trace BIFs, - is still available, see eprof manual page under the - application tools. Eprof shows how much time has been used by - each process, and in which function calls this time has been - spent. Time is shown as percentage of total time, not as - absolute time.

+ matter of calling a few library functions, see + fprof + manual page under the application tools.fprof was introduced in + version R8 of Erlang/OTP. +

+
+ eprof +

+ eprof is based on the Erlang trace_info BIFs. Eprof shows how much time has been used by + each process, and in which function calls this time has been + spent. Time is shown as percentage of total time and absolute time. + See eprof for + additional information. +

+
+
cover -

cover's primary use is coverage analysis to verify +

+ cover's primary use is coverage analysis to verify test cases, making sure all relevant code is covered. cover counts how many times each executable line of code is executed when a program is run. This is done on a per module basis. Of course this information can be used to determine what code is run very frequently and could therefore be subject for optimization. Using cover is just a matter of - calling a few library functions, see cover manual - page under the application tools.

+ calling a few library functions, see + cover + manual page under the application tools.

@@ -139,8 +153,11 @@ cover regarding features. It counts how many times each function is called when the program is run, on a per module basis. cprof has a low performance degradation effect (versus - fprof and eprof) and does not need to recompile - any modules to profile (versus cover).

+ fprof) and does not need to recompile + any modules to profile (versus cover). + See cprof manual page for additional + information. +

@@ -170,7 +187,7 @@ eprof per process/function to screen/file medium - significant slowdown + small slowdown yes only total no -- cgit v1.2.3