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