11 ms·
HipHop VM: now at 98.5% PHP framework parity, 16% faster
- shin_lao 13y agoI'm not sure I understand. Is this the framework that "compiles" PHP? Is the 15% performance increase relative to vanilla PHP or to a previous version of HHVM?
- Osiris 13y agoHHVM is a JIT engine for PHP code. The performance increase in relative to the previous release of HHVM.
- plorkyeran 13y agoHipHop was the PHP -> C++ compiler. HHVM is a JIT-compiled implementation of PHP. The 15% increase is relative to HHVM at the beginning of the 3-week sprint they just completed. HHVM was already far faster than vanilla PHP when it was first publicly announced over a year ago.
- ed 13y agoThat's more interesting. How much faster is hhvm overall?
- LogicalBorg 13y agoThe Wikipedia article (https://en.wikipedia.org/wiki/HipHop_for_PHP https://en.wikipedia.org/wiki/HipHop_for_PHP) says "up to 6x", however, about 2x speedup versus plain PHP was a more typical experience for me when I used it before.
- porker 13y agoThat's a good question. PHP 5.5 with the newly-open sourced (and integrated) opcache gave it a good run for its money before this optimisation sprint [1]. Under real-world 'bloated framework' usage, HHVM was already pretty cool [2]. I'd like to see the results after this speedup. 1. For simple code only - once it's more computationally intensive, HHVM wins. http://www.alexfu.it/2013/10/22/symfony-benchmark-on-hhvm.html http://www.alexfu.it/2013/10/22/symfony-benchmark-on-hhvm.ht... 2. http://blog.liip.ch/archive/2013/10/29/hhvm-and-symfony2.html http://blog.liip.ch/archive/2013/10/29/hhvm-and-symfony2.htm...
- togasystems 13y agoOther than Facebook, does anybody have HipHop running in production? Any big caveats?
- girvo 13y agoMe! Yeah, it's not 100% compatible, so my app runs all it's tests on HHVM to make sure I haven't run into any edge cases, which hasn't been an issue. I get more mileage out of my smallish VPS from it, with no effort on my part other than knowing what frameworks don't work (very very few now) and testing before deploying to staging (as you should be anyway). I'm pretty happy with it. Is it worth it? Well, if you've got a test suite, run it through HHVM to see if you'll have any issues. If the answer is no, then why turn down free performance :)
- frik 13y agoI run HHVM on a website. I started in June (back then you had to write your config file from scratch and some API functions were missing). I refactored my code to PDO (mysqli was missing back then). It worked fine from the beginning, and the uptime and overall performance is really great. I use Nginx as frontend and direct all dynamic request to HHVM's own webserver (https://github.com/facebook/hhvm/wiki/Using-nginx-as-Front-Server-to-HipHop https://github.com/facebook/hhvm/wiki/Using-nginx-as-Front-S... ) Keep in mind, Facebook runs on HHVM too, so it's rock solid. Btw. the devs are very helpful on the official irc channel!
- deleted 13y ago[deleted]
- debacle 13y agoThe performance increase in relative to the previous release of HHVM.
- danso 13y agoWith the recent discussion on the origins of PHP function names, and about what, if anything, can be done to fix PHP without ruining it...I'm curious about what happens at Facebook. Besides HipHop, do they maintain a strict PHP style among their developers? Even if HipHop can handle all of PHPs variations, I imagine there's time saved by writing optimally-designed (for the human) code, too?
- pjmlp 13y agoYes, they have a static analyser for PHP, Hack, written in OCaml http://www.youtube.com/watch?v=gKWNjFagR9k http://www.youtube.com/watch?v=gKWNjFagR9k
- kodablah 13y agoInternally at my company, we've found https://github.com/scrutinizer-ci/php-analyzer https://github.com/scrutinizer-ci/php-analyzer to be very effective (after we made some hacks to support 5.5) and we can put it in our sniff pipeline in CI (a tad too slow for a pre-commit hook).
- meowface 13y agoFor core language features like that, there really is no way to "fix" it. Just pick a better language.
- stusmall 13y agoPoor choice of function names are the easiest of problems to fix. Write an internal base framework that you use and strongly discourage the use of functions outside of it. Even if the new set of APIs are as simple as just forwarding the call to the standard PHP one with reversed arguments, using one example people complain about all the time. This isn't hard to do, doesn't require a lot of upfront work (add APIs as you go) on a new project, and won't give you too much (if any) of a performance hit. You don't need to burn the house down because you don't like how the furniture is arranged.
- 13y ago
- thevert 13y agoWhat does a Lockdown implies?
- nbm 13y agoI'm not sure about the particulars of this one, but a lockdown is generally a period where you are encouraged to prune away unnecessary and/or lower-priority requests for your time. There generally aren't a lot of status meetings, team meetings, project meetings, and so forth at Facebook, but you might want to turn down a request to present at another team's meeting, or turn down those requests to interview - they can wait, or another person can be found. People tend to make progress on lower-priority work items in between higher-priority work items - things like migrating onto a new library or version of a service, or maybe migrating from one set of machines to another if you aren't using one of the high-level service management systems. This is necessary to prevent these things from becoming interrupt items down the line, but during a lockdown period, it's okay to let these slide for a bit. If the whole team does this, then suddenly you're spending a lot more time together. Instead of potentially working on different parts of the software like you usually do, you can all focus on a particular class of problem - in this case, performance and parity. That means everyone has that context loaded up, and you can have better discussions and quicker code reviews.
- deleted 13y ago[deleted]
- deleted 13y ago[deleted]
- ohashi 13y agoI see a lot of familiar frameworks and CMSs except one. Wordpress. Any idea why Drupal and Joomla would be listed without WordPress?
- ptarjan 13y agoWordpress' unit test suite was just too gnarly to get running with our test harness. Send us a pull request if you can get it working. https://github.com/facebook/hhvm/blob/master/hphp/test/frameworks/run.php https://github.com/facebook/hhvm/blob/master/hphp/test/frame...
- michaelmior 13y agoIt seems at the moment there's no way to have a DB server available when running tests. Is that correct? Until that happens, I don't imagine WP tests will be able to run.
- jakejake 13y agoThey mention the compatibility of the projects unit tests with their own testing so perhaps WordPress has some things in their test setup that didn't fit. They mentioned CakePHP as another example that wasn't included.
- deleted 13y ago[deleted]
- deleted 13y ago[deleted]
- tim333 13y agoApparently there are some incompatibilities such as Wordpress using some case insensitive constants to support some old plugins while HipHop does not support that. As in http://www.hhvm.com/blog/113/getting-wordpress-running-on-hhvm http://www.hhvm.com/blog/113/getting-wordpress-running-on-hh...
- michaelmior 13y agoI haven't looked into integrating with the test harness, but the test suite was pretty easy to get running locally. Unfortunately it crashes halfway through, but up until that point, the majority of the tests passed.
- Keyframe 13y agoHmmm Laravel at 100%. This is now getting interesting!
- dubcanada 13y agoDrupal is also 100%, that's actually really nice. Want a quick performance boost on your Drupal site, replace PHP with HHVM
- rb2k_ 13y agoThis is core though, from what I hear contrib still breaks (haven't tried myself)
- Jgrubb 13y agoI tried it two days ago after they made the fastcgi announcement. My day job sites are fairly big with what I consider a pretty large number of contrib modules. I managed to get it up and running, but the HHVM logs were full of notices and it finally bombed out after several requests (not enough to really warm up the VM) on something related to apachesolr, and another one related to GD, which is strange because we use imagemagick, but whatever. Sad Trombone. The really cool part though, it truly was "drop in". Every bit of my existing nginx/fpm configs worked as is, so once it's a bit further along, it's just a matter of shutting down fpm and firing up HHVM. There were also a couple of gotchas in the setup related to the fact that their apt installer installed HHVM configs that don't assume Fastcgi, so it took a little bit to figure out the correct edits to the init script and HHVM config so it'd listen on :9000 instead of :80, but all in all that it worked at all was really fun for a minute. Very excited about this project.
- testing12341234 13y agoLaravel is technically at 100%, however the unit tests are throwing a lot of warnings. compare: php 5.5: https://travis-ci.org/laravel/framework/jobs/15683979 https://travis-ci.org/laravel/framework/jobs/15683979 hhvm: https://travis-ci.org/laravel/framework/jobs/15683980 https://travis-ci.org/laravel/framework/jobs/15683980
- digitalnalogika 13y agoDoes anyone have an easy method of testing HHVM on your website? I was thinking of recording the production requests for x amount of time and replaying them on HHVM so you could see if responses are identical, there are no crashes, state of the database is same afterwards, etc.?
- girvo 13y agoA good test suite? ;) Seriously though, I decided that if I had a project that was difficult to test, that I knew had hairy code that used some funky features it was best to just stick to APC. All my new projects are being built on HHVM directly with test suites as I go. Edit; that was a while back now, though. What frameworks and libraries are you using? Run their test suites through HHVM and if they all pass, you'll be fine. Facebook use it themselves now apparently.
- dan15 13y agoRecording requests is a good idea. Another idea once you're reasonably comfortable and have done a smoke test is to direct a small amount of your traffic/users (say 1%) to the HHVM version, while closely monitoring its error log.
- AlexanderDhoore 13y agoI wonder how hard it would be (for me) to take php and change all function names to be consistent. All PascalCase and spelled out (no awful abbreviations). Then download the documentation and change it there as well.
- jemfinch 13y agoFirst you'd have to make sure your string hash function isn't strlen.
- deleted 13y ago[deleted]
- duaneb 13y agoI thought this was a joke at first....
- meritt 13y agoAhh yes, take the most criticized aspect of Java -- the obscene verbosity -- and cram it into PHP. Sounds wonderful.
- AlexanderDhoore 13y agoI'll take a long function name over an incomprehensible one any day.
- elwell 13y agoNice! CodeIgniter is at 100% now. I've been contemplating the switch to hhvm for my startup, now it seems likely.
- dpcx 13y agoDon't take this the wrong way, but you're actually developing new applications with CodeIgniter? Ugh...
- Gigablah 13y agoYeah, Laravel is pretty much the modern framework for people who can't divorce themselves from CodeIgniter.
- meowface 13y agoAs someone who can't stand PHP, Laravel is pretty much the only thing that's made me feel like the language has some worth. It feels very similar to the Python and Ruby frameworks I'm used to, and is actually pretty nice to read. Now if only the rest of the PHP devs stuck in 2005 would switch to it...
- dan15 13y agoWhat does Laravel do that other frameworks like FuelPHP and Yii don't do? I hear a lot about it but don't hear a lot about why it's so much better than others.
- Gigablah 13y agoOn the surface most of the popular PHP frameworks are not much different from each other. Basic MVC separation, some sort of dependency injection container (actually a service locator), Composer and standardized autoloading, etc. Once you dig into the coding aesthetics then the differences start to become clear. Yii isn't PSR compliant, both FuelPHP and Laravel make liberal use of Facades and/or __callStatic to preserve the style of static function calls that are prevalent in CodeIgniter. I guess what makes Laravel stand out is the sheer amount of documentation and examples that are available, both on the website and in the code itself. This makes it really easy to get started. Me, I'm not really keen on the Component::function() syntax. Feels like a crutch to me. Especially when people go out of their way to avoid specifying namespaces by abusing class_alias. Plus you're not really saving that many keystrokes compared to, say, $this->app['component']->function(). (Yes, I like Silex).
- sideproject 13y agoIs there a good tutorial on installing HHVM on server and then running your PHP app?
- frik 13y agoYes, on the official wiki: https://github.com/facebook/hhvm/wiki/_pages https://github.com/facebook/hhvm/wiki/_pages First read the page related to your Linux/BSD e.g. "Prebuilt Packages on Ubuntu 12.04" Then read the page "Using nginx as Front Server to HipHop" As last step read this blog article how to write/edit the config file (/etc/hhvm.hdf): http://www.hhvm.com/blog/113/getting-wordpress-running-on-hhvm http://www.hhvm.com/blog/113/getting-wordpress-running-on-hh... Read this and copy things you need from the documentation: https://github.com/facebook/hhvm/blob/master/hphp/doc/options.compiled https://github.com/facebook/hhvm/blob/master/hphp/doc/option... This is how I got HHVM working. To sum up: * you need a little bit of basic Linux knowledge * install Linux or BSD (e.g. Ubuntu 12.04 LTS) (64-bit) * install Nginx (or since last week HHVM also supports Apache with FastCGI) * install HHVM * install MySQL or MariaDB, etc. * create a web directory where you place your php files * edit the hhvm.hdf (config file) * start hhvm Btw. a lot of blog posts you find with Google search are still about the old HpHp (the former and now outdated PHP to C++ translator also called HipHop from FB)... so better skip third party blog posts older than January 2013 ;)
- dekz 13y agoHey guys, congrats on the release. Any news about Hack coming out any time soon?