Note that the realpath cache is not used if either safe_mode is on or an open_basedir restriction is in effect.
This is having a huge performance effect, causing lots of calls to lstat.
A bugreport has already been filed at http://bugs.php.net/bug.php?id=52312