View Single Post
Old 17th May 2008
yurtesen yurtesen is offline
Port Guard
Join Date: May 2008
Posts: 18

I already put a note for this in my post with the code. If you compile the program with -pg flag then the source code lines are visible in the objdump -S output. (so I didnt enter them myself, and actually I am not sure if -g flag is also necessary at the moment but I used -pg and -g at the same time). For using -pg flag, you need to have profiled libraries installed in your system.

This also allows gprof to profile the code line-by-line so you can see exactly in which line code your program is spending time when you run gprof. Normally gprof only shows statistics in a function level which is not very useful.

I am writing my master's thesis on code optimization so I have been experimenting quite much with these stuff lately. You would be amazed how much performance increase one can get when you change one variable to use a cpu register actually in a certain program which is they run on supercomputing clusters, with kind of change(and few other changes) we have achieved 2 times speed increase where the program running 1 month could finish in 2 weeks only.

If you are interested in these stuff you might find intel vtune and amd codeanalyst quite interesting as well.
Reply With Quote