Commit | Line | Data |
---|---|---|
69fba935 | 1 | \" @(#)intro.me 1.5 %G% |
156c6def PK |
2 | .ls 2 |
3 | .sh 1 "Programs to be Profiled" | |
4 | .pp | |
5 | Software research environments | |
ff6d2c7c | 6 | normally include many large programs |
156c6def PK |
7 | both for production use and for experimental investigation. |
8 | These programs are typically very modular, | |
9 | in accordance with generally accepted principles | |
10 | of good program design. | |
11 | Often they consist of numerous small routines | |
12 | that implement various abstractions. | |
13 | Sometimes such large programs are written | |
14 | by one programmer | |
15 | who has understood the requirements for | |
16 | these abstractions, and has programmed them | |
17 | appropriately. | |
b166544d PK |
18 | More frequently the program has |
19 | had multiple authors and has | |
156c6def PK |
20 | evolved over time, changing the demands placed |
21 | on the implementation of the abstractions without | |
22 | changing the implementation itself. | |
23 | Finally, the program may be assembled from a library | |
24 | of abstraction implementations | |
25 | unexamined by the programmer. | |
26 | .pp | |
27 | Once a large program is executable, | |
28 | it is often desirable to increase its speed, | |
29 | especially if small portions of the program | |
30 | are found to dominate its execution time. | |
31 | The purpose of the \fBgprof\fP profiling tool is to | |
32 | help the user evaluate alternative implementations | |
33 | of abstractions. | |
34 | In fact, we developed this tool in response to our efforts | |
b166544d | 35 | to improve a code generator we were writing [Graham82]. |
156c6def | 36 | .pp |
b166544d | 37 | The \fBgprof\fP design takes advantage of the fact that the programs |
156c6def PK |
38 | to be measured are large, structured and hierarchical. |
39 | We provide a profile in which the execution time | |
40 | for a set of routines that implement an | |
41 | abstraction is collected and charged | |
42 | to that abstraction. | |
43 | The profile can be used to compare and assess the costs of | |
44 | various implementations. | |
b45b179a | 45 | .pp |
69fba935 PK |
46 | The profiler can be linked into a program without |
47 | special planning on the part of the programmer. | |
48 | The overhead for using \fBgprof\fP is low; | |
49 | both in terms of added execution time and the | |
50 | volume of profiling information recorded. |