Sorting the output by "Total Self" (which is the total amount of time spent executing that particular function, not counting time in subfunctions) the biggest consumers are:
That lot is fully half the 4.262 seconds it took to load Craig's HomePortal dashboard, and of that 639ms is spent in classloading and 812ms in include/require functions. Oh, and the PHP files loaded by those functions don't look particularly complex (Mysmarty.php contains an if !defined('basepath'), a require, and a class definition) so I don't think it's doing much real work in that time. This does still suggest that a fair chunk of time is spent just parsing PHP code.
The next step is probably to add a PHP parser/opcode cache and see if that helps. I'm going to pick the Zend OPcache for no particular reason. Unfortunately their website has no documentation whatsoever, but fortunately the tarball does include a README with destructions. So, here goes...
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
Lots of tests...
checking build system type... ./config.guess: unable to guess system type
Well, I know what to do with that at least. It'd be useful if all these autoconf-users updated to something vaguely current (configure claims it was last modified in 2005!).
Thomas@Athena:~/zendopcache-7.0.3$ wget "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD" -O config.guess
Thomas@Athena:~/zendopcache-7.0.3$ wget "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD" -O config.sub
Lots of pointless tests (why is it checking for a Fortran compiler anyway?)...
Well that didn't take long to fail. Some searching throws up this bug for a different PHP extension which exactly matches what's happening here. Which would suggest that the latest Zend OPcache hasn't actually been tested with PHP 5.2 (despite claiming to support that version). Anyway... I added typedef unsigned long zend_uintptr_t; to /usr/include/php5/Zend/zend_types.h and tried again:
Unfortunately there's almost nothing online relating to this error, and a quick grep through the headers in /usr/include/php5 didn't throw it up either. My PHP-fu isn't anywhere near strong enough to start digging into the internals so I've given up at this point. I have at least raised a bug about the compiler errors, so let's see where that goes...