Zend Framework Classloading Performance

As outlined in the Zend Framework Documentation it’s possible to speed things up a little by removing (almost) all require_once calls from the Framework and relying solely on the autoloading mechanism. I haven’t benchmarked this and I’m fairly certain that it’s a case of micro-optimization but I thought I’d give it a try anyway. The snipped posted there has some minor problems on OS X however. For one the -wholename parameter for find isn’t implemented (can be replaced with -path) and although sed does work, you need to use gsed if you want to pass the arguments as described in the documentation. So here’s the OS X version of the snippet:

find . -name '*.php' -not -path '*/Loader/Autoloader.php' \
  -not -path '*/Application.php' -print0 | \
  xargs -0 gsed --regexp-extended --in-place 's/(require_once)/\/\/ \1/g'
Published on Aug 25, 2009 at 9:56 pm by Jan Gorman.
Filed under: Code Tags:, , , , , , , , , , , | No Comments