I am a php developer and sometimes if I work on a complex project I use xdebug + profiler + cachegrind to generate flow diagrams. It shows not only how often a method was called and how much memory it used but also where the call came from and what happened next. It helps sometimes to understand the code better. I use it mostly for debugging.