re-organize
This commit is contained in:
@@ -61,7 +61,6 @@ int main() {
|
|||||||
- **Flat Profile**: Shows execution time spent in each function.
|
- **Flat Profile**: Shows execution time spent in each function.
|
||||||
- **Call Graph**: Displays function call relationships and their execution time.
|
- **Call Graph**: Displays function call relationships and their execution time.
|
||||||
|
|
||||||
The profiling results show that heavyComputation() takes significantly more execution time than lightComputation(), even though lightComputation() is called 1000 times.
|
|
||||||
The flat profile from gprof also indicates the percentage of time spent in each function, helping to identify bottlenecks. For the above test program, the flat profile is like this:
|
The flat profile from gprof also indicates the percentage of time spent in each function, helping to identify bottlenecks. For the above test program, the flat profile is like this:
|
||||||
|
|
||||||
```plaintext
|
```plaintext
|
||||||
@@ -73,6 +72,8 @@ Each sample counts as 0.01 seconds.
|
|||||||
0.00 0.28 0.00 1 0.00 0.00 __static_initialization_and_destruction_0(int, int)
|
0.00 0.28 0.00 1 0.00 0.00 __static_initialization_and_destruction_0(int, int)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
As can be seen, the profiling results show that heavyComputation() takes significantly more execution time than lightComputation(), even though lightComputation() is called 1000 times.
|
||||||
|
|
||||||
Note: The __static_initialization_and_destruction_0(int, int) function is generated by the compiler during the static initialization and destruction phases of a program, particularly for global or static variables.
|
Note: The __static_initialization_and_destruction_0(int, int) function is generated by the compiler during the static initialization and destruction phases of a program, particularly for global or static variables.
|
||||||
|
|
||||||
## Best Practices for Using `gprof`
|
## Best Practices for Using `gprof`
|
||||||
|
|||||||
Reference in New Issue
Block a user