What you seem to want is a combination of vmstat, iotop, sysstat/sar, and powertop, just like mentioned above. However, you want to stay away from large utilities (htop, dstat), because they will skew the very data you're trying to observe. When you run top, what is usually the most busy process? TOP! That violates scientific principles of observation. You want your probes to be as lightweight as possible.
The most you can usually learn about where the process spends most time by running it through ltrace and strace. If most time goes to userland numbercrunching, you cant fix it unless you redo the algorithm. If most time is spent in system calls, you gotta see what and how you're using OS resources, maybe you're waiting on locking to get done, or you're forcing filesystem flushes too often. There are no hard rules for this stuff, just run all the usual utilities and see which one blinks something meaningful at you. Knowing your syscalls and error calls especially when reading strace reports can be extremely enlighting too.