Use a profiler
Use callgrind/xdebug/xhprof/xhgui to find problems
Example: Callgrind catching an unset timezone
Example: An Xdebug profile
Example: Using Xdebug to try to understand Wordpress