The required tools:
1. Run the tool called callgrind (which is part of the valgrind suite):
valgrind --tool=callgrind2. This would create a file of the format:callgrind.out.[parameters]
3. Run KCacheGrind and load the callgrind output file in to it.
Now you would have a visual representation of the calls made by each method displayed as a percentage of the total call count via a rectangular area diagram.
4.
- If you have a method which you would like to optimize, change the grouping to "Class" and search for the method in order find it quickly.
- Otherwise, look for the methods which are called the most and optimize them.
5.Also try to lower the call count to these methods by modifying the callers to re-use values
Also Refer:
No comments:
Post a Comment