Attack of the PHP clones: Drupal, HHVM, and Vagrant
For those wanting to give it a spin, Metal Toad has added HHVM support to our Vagrant box: github.com/metaltoad/trevor.
Twenty years after PHP was created, we are on the cusp of having an alternative to the Zend Engine enter the mainstream: Hip Hop Virtual Machine (HHVM, created by Facebook). One of the most interesting things I learned at Drupalcon Austin (hat tip to Josh and David from Pantheon) is that HHVM already passes 100% of the unit tests for many popular apps and frameworks (including Drupal), with more getting closer every day. Considering the substantial speed gains of HHVM's just-in-time compiler, switching will be a big win for many organizations. I was able to roughly halve the response time of this blog with HHVM, similar to results reported by Pantheon.
I had hoped to migrate our blog in production, but hit a snag:
SimpleXMLIterator is not yet supported in HHVM, and SimpleXML is required for Mollom (our spam filter). Since the HHVM engine is so different, existing Zend extensions such as this cannot be used, and porting them is non-trivial. Hopefully this gap will be filled soon, and we'll re-test.
The development of HHVM has led to another curious contribution: PHP now has a spec!
One side note about benchmarks – I found that HHVM performed worse than Zend when using VirtualBox's shared folder to hold the code. So if you are benchmarking with Vagrant, you should move the code inside the VM's virtual disk first.
similar to eaccelerator or any other php optimizer/cacher, it's the many mtime checks that happen that slow down over network filesystems - vboxsf being the worst. and if your drupal site has a ton of modules it is unusably slow.
if you are forced to run vboxsf instead of VM disk through rsync-auto or whatnot, the fix is to disable mtime checking. however this would mean you won't have realtime code updates so it only makes sense for a production instance of the VM.
Wed, 08/13/2014 - 14:20