Slow Composer on OS X?

If your composer install is painfully slow, then this might be the fix for you. I got to a point where it was taking a REALLY long time to run simple updates using PHP 5.6.15. Sure sure, PHP7 is around the corner, but I couldn't sacrifice my dev environment which reflects our deploy requirements.

First, Homebrew

If you don't have Homebrew on your machine, well, it's never too late to do the right thing. You can get more details at http://brew.sh. Installation is simple:

Then, HHVM

If you aren't familiar with HHVM, it's all here: http://hhvm.com. Essentially, it was a turbocharged PHP created by the folks at Facebook. They did excellent work to be honest, and the performance gains were staggering. Performance differences between PHP7 and HHVM were certainly the elePHPhant in the room.

Get HHVM installed with Homebrew like so:

brew tap hhvm/hhvm
brew install hhvm

That one will take awhile. Go Netflix'n'chill for a few and check it when you're "done".

Last, Composer Alias

This part is very simple. You just need to create an alias in your ~/.bash_profile file. If it doesn't exist, create it. From Terminal, issue this command: