Skip to content

Instantly share code, notes, and snippets.

@pgodel
Last active August 29, 2015 13:59
Show Gist options
  • Save pgodel/10742902 to your computer and use it in GitHub Desktop.
Save pgodel/10742902 to your computer and use it in GitHub Desktop.
test to install symfony deps using PHP and HHVM
#!/bin/bash
# Instructions
# run: php composer.phar create-project symfony/framework-standard-edition test 2.4.3 --no-scripts
# cd test and download and run this script
if [ ! -f composer.phar ]; then
curl -sS https://getcomposer.org/installer | php
fi
echo Deleting vendor...
rm -rf vendor
echo PHP test
time php composer.phar install --prefer-dist --no-scripts
echo Deleting vendor...
rm -rf vendor
echo HHVM test
time hhvm composer.phar install --prefer-dist --no-scripts
@pgodel
Copy link
Author

pgodel commented Apr 16, 2014

So, we agree that running composer install with HHVM results in slower execution than PHP. I understand the issue with the JIT cache on CLI. But in my tests, HHVM takes longer than PHP, much longer than the JIT initialization. In the best case scenario, HHVM should be the same or roughly the same speed as PHP, not many seconds slower. The bigger the number of deps, the larger the gap is.

My point is, lots of people recommend to run composer with HHVM which is fine if you are using it for doing the update. But if you are using it for install then it will run slower. So doing the aliasing to always run composer with HHVM is not a good idea at the moment, until the HHVM team improves the performance around whatever composer install is doing.

@pgodel
Copy link
Author

pgodel commented Apr 17, 2014

@stof adding --dry-run clearly shows a major improvement in execution time, but why would I do that? Nobody will run composer with --dry-run. I want to test a real use case, not a theoretic one.

@gustavotemple
Copy link

Hack vs PHP (Computer Language Benchmarks Game):

http://benchmarksgame.alioth.debian.org/u64q/hack.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment