Difference between revisions of "Profile"
Hzwakenberg (talk | contribs) |
Hzwakenberg (talk | contribs) m |
||
Line 1: | Line 1: | ||
− | + | LibertyEiffel offers an ''embedded profiler''. That means that to use it, you have to compile your |
|
application with a special <TT>-profile</TT> option. The generated executable will then be equipped with the profiler and you can start your application in the normal way. |
application with a special <TT>-profile</TT> option. The generated executable will then be equipped with the profiler and you can start your application in the normal way. |
||
Revision as of 16:23, 13 October 2014
LibertyEiffel offers an embedded profiler. That means that to use it, you have to compile your application with a special -profile option. The generated executable will then be equipped with the profiler and you can start your application in the normal way.
Note: -profile is available only with compile_to_c (or compile).
At the end of a program run, the profiler lets you obtain certain information about its execution. All this information is written into a file called profile.se in the current directory.
Results obtained
The file profile.se is produced at the end of the program run, just before control is returned to the user.
This file contains two kinds of information: execution times and a graph of feature calls.
The information is presented first in summary and then in detail.
Although it is human-readable, the file contains a great deal of information. It might be useful in the future to build a utility to extract some of this information.
Execution graph
For each function, the profiler gives the following data:
- number of calls: how often the function has been executed.
- callers: by which functions it has been called, and how many times.
- callees: which functions it has called, and how many times.
Execution times
Note: because it is embedded, the profiler slows the program down; it is necessary to take this into account and regard the times reported as relative, never as absolute times.
For each function, the profiler displays two times:
- cumul time (cumulative time) which is the total time spent in the function and the functions it calls.
- own time which is the time spent only in the function itself, apart from calls to other functions.
Since the number of calls to each function is known, an average time is also given.
The summary displays all the data together, sorted by own time.