Why does pgprof show execution times that are 10X the actual run time?
When using sample-based profiling (e.g., gmon.out), the number of samples per second is defined by sysconf(_SC_CLK_TCK). However, on some systems the value returned is not the same as the actual sampling rate. It will usually be off by a factor of 10. You can determine if your system has this problem by using “time a.out” and comparing it to the total time shown in the profile.