6 ms·
Wikipedia on HHVM
- azinman2 12y agoCongrats to FB for donating their engineering resources to helping Wikipedia. How do we make this more the norm for large corporations with talent? Something akin to Google's 10% time but with a social-good focus? It might help silicon valley's reputation in a larger sense.
- TazeTSchnitzel 12y agoBear in mind that Facebook has a vested interest in getting other large sites to use HHVM, so that they're not the only ones who want to maintain it. They're not doing this purely for the greater good. That said, I agree, Facebook is doing awesome stuff here.
- ics 12y ago> so they're not the only ones who want to maintain it Being completely unaffiliated with Facebook, I think this still counts as 'greater good' for many.
- TazeTSchnitzel 12y agoSure. I'm just saying that they have business motives to do so, it is not merely out of the kindness of their hearts. Though I am sure it is also partly the latter, they have some wonderful engineers. :)
- azinman2 12y agoAs far as I'm aware, HHVM isn't something that FB is charging for. If that's true, what's the business interest?
- TazeTSchnitzel 12y agoThe same one I mentioned before: getting other people to use it benefits them, as other people will help maintain it because they also have a stakehold in its success. It's a huge project to maintain.
- MichaelGG 12y agoIs it a huge project to maintain? I thought the first HipHop implementation was a 2-person side project. Relative to FB's size, does it matter even if they had to put 10 people on it?
- TazeTSchnitzel 12y agoOriginally, yes, but it's grown since then, and bear in mind that it is critical infrastructure that Facebook are now completely dependant on.
- mgkimsal 12y agoThe other business interest is... as it gets more adopted, more people will know the ins and outs, and the talent pool for them to pick from will grow. More other businesses using it also makes it harder for people to make the argument against it as "it's just a Facebook thing"
- TazeTSchnitzel 12y agoYes. It's probably hard to hire developers if they must program in an obscure internal-only dialect of PHP (Hack).
- TazeTSchnitzel 12y agoThat comment got downvoted to -1! I'm not saying Hack is obscure and used only by Facebook - but it would have been had Facebook not open-sourced HHVM and tried to promote its use.
- EGreg 12y agoThat is even better! Because that creates incentives to continue supporting it. In the last several years I've spoken to libertarians, conservatives, progressives, various schools of economics etc. It's become clear to me that when platforms are free, more wealth is created. When Netscape open sourced their codebase, we got Firefox and WebKit. Linux, Webkit, WikiWikiWeb, Git, in fact all those image formats you can display without paying royalties or risking getting sued, obviously led to more wealth creation than proprietary siloed codebases. Eventually even MS opensourced their platform, after years of copying by Mono.
- atdt 12y agoJust to underscore your point: I'm an engineer at Wikimedia, and I worked quite closely with Brett, the author of the blog post. As a small nonprofit operating a very popular site, we're accustomed to being approached by salespeople camouflaged as altruists, and over the years we've developed a pretty good nose for that sort of thing. The people on the HHVM team with whom I interacted were palpably genuine and nice, helping us out at odd hours of the night, and asking for absolutely nothing in return. They're wonderful people, full stop.
- notfoss 12y agoI think a better example would be Btrfs. Facebook hired the lead Btrfs devs and they are still contributing to Btrfs development. And this is because Facebook is very interested in Btrfs themselves.
- killertypo 12y agohow does HHVM compare to PHP 7 in terms of speed savings? PHP 7 is supposed to be pretty damn fast from what I have seen. I guess benchmarks are hard to read because they're dependent upon a lot of factors. It would be interesting to see two sites at similar scales running competing engines for PHP (hhvm vs. PHP 7).
- TazeTSchnitzel 12y agoMinor point of style: We tend to refer to phpng in lowercase, because that's the branch name. Although at this point, since it no longer exists as a branch (it's long since been merged into trunk) and there have been subsequent performance optimisations, the names "PHP 7" or "Zend Engine III" are possibly better. Also, I partly responded to this above: https://news.ycombinator.com/item?id=8848129 https://news.ycombinator.com/item?id=8848129
- killertypo 12y agoTIL, thank you for that.
- debacle 12y agoI have seen anywhere from 100% to 50% faster, with lower memory usage overall.
- TazeTSchnitzel 12y agoThey note that 5.6 has some substantial performance improvements over 5.3. I'd point out that PHP 7, coming out later this year, will be even faster (perhaps as much as 2x 5.6), since some very smart people have done some big internal refactoring in the Zend engine, largely to reduce allocations, pointer indirection, and memory usage. These efforts combined have resulted in pretty big performance gains, making PHP 7 more competitive with HHVM performance-wise. In addition, writing PHP extensions is somewhat nicer now. Zeev Suraski (one of the original two Zend Engine authors along with Andi Gutmans, also co-founder of Zend, Inc.) did some benchmarks: http://zsuraski.blogspot.co.uk/2014/07/benchmarking-phpng.html http://zsuraski.blogspot.co.uk/2014/07/benchmarking-phpng.ht... http://zsuraski.blogspot.co.uk/2014/07/benchmarking-phpng-magento.html http://zsuraski.blogspot.co.uk/2014/07/benchmarking-phpng-ma... However, bear in mind that those benchmarks were faked* by Zeev, a Zend Engine proponent. Benchmarks faked* by HHVM engineers might show a larger gap. ;) * I'm not using "faked" in its normal sense. They probably weren't fraudulent, but I am a believer that we should say "fake a benchmark" and not "make a benchmark" given that they can be so circumstantial and misleading: http://blog.ajf.me/2014-10-23-on-benchmarks http://blog.ajf.me/2014-10-23-on-benchmarks Disclaimer: I am, myself, biased towards the Zend Engine, I'm a php-src committer.
- scott_s 12y agoI make a point to say "synthetic benchmarks" for such circumstances. It clearly conveys that the benchmark is contrived, likely to demonstrate a particular point, but it avoids the negative connotations.
- TazeTSchnitzel 12y agoAh, that's a good term for it. I like "faked" because it has added humour value (it's rather "ha ha only serious"). Without using a disclaimer around it, though, someone will probably smack me.
- eru 12y agoUse `fake' in speech, where you can convey more context, and `synthetic' in writing?
- ahoge 12y agoThe y-axis of the first graph should start at 0. Being more than twice as fast is quite a lot. There is no need for cheap tricks. If you aren't visualizing tiny deltas, don't truncate the y-axis. It's misleading.
- thehal84 12y agoThis is great news to see. I have tested HHVM with our particular application load and I found it to be a bit tricky to tune just right. However PHP 5.6 has been solid in production for us handling 5 billion requests daily.
- girvo 12y agoHooray! I'm a massive fan of HHVM, though not just because it's so fast: Hack is something I'm really interested in. The collections libraries in the stdlib are brilliant to use, and the static typing makes writing some types of code easier and keeps some bugs out of my codebase. The only thing I wish to see is more editor/IDE support for it, so I helped contribute to hack-sublime and have been writing my own plugin for Komodo Edit/IDE. HHVM and Hack were the impetus for me to learn OCaml, which is a lovely language. It's good to see more and more places picking up HHVM, and it's also great to see PHP5.6 and 7 increasing performance drastically, too!
- cdnsteve 12y agoThank you to both Wikipedia and Facebook for being transparent and sharing this back to the open source community. It's these type of joint efforts that really move the web forward. Hats off.
- nodesocket 12y ago"Peak CPU utilization dropped from about 70% to 12%, almost a 6x improvement." That is substantial, and HHVM should bear to rest some of the claims (trolls) that PHP is not performant.
- reitzensteinm 12y agoThat you can claw back some performance by using a partially conforming alternate language implementation does not prove the "trolls" wrong. Yes, with enough engineering effort you can move mountains, but if performance is critical and you don't have a legacy code base like Facebook does, reaching for the php hammer is insanity. The real reason why performance isn't a big downside with php is that it usually just doesn't matter. If a php implementation can service 100 req/s, and a Java implementation (an ad absurdum) 100,000 req/s, and your site peaks at 5 req/s, either is just fine. In other words, "You're probably not Pintrest".
- thezilch 12y agoPHP performance is/was not a reason to not use it, if there was ever a reason you'd be "insane" to do so. Pinterest runs on a "slower" Python/Django stack, for that matter.
- TazeTSchnitzel 12y ago> That you can claw back some performance by using a partially conforming alternate language implementation does not prove the "trolls" wrong. You're talking as if PHP is slow. It isn't, it's very fast, speed is actually one of its advantages (or was historically, anyway). Its alternatives (Python, Ruby) are sometimes marginally slower. With its next release, it will receive a significant performance boost, and minor versions usually include small but significant performance gains. Yes, it's not as fast as say, C, C++, Java, C#. It doesn't need to be, nor does anyone expect it to be: it's a dynamic language that allows for rapid development. But to talk about it like it's something horribly slow that you'd never use in 2015 is simply wrong. It is competitive.
- debacle 12y agoHHVM is a completely new interpreter, so it has nothing to do with the Zend interpreter's performance. That said, PHP is (and has been) faster than both Ruby and Python and does some things faster than Perl. It shouldn't be expected to compete with Java or Go.
- chubot 12y agoIntersting, I didn't realize PCRE now has JIT support. http://sljit.sourceforge.net/pcre.html http://sljit.sourceforge.net/pcre.html Also, that page points to Apple's YARR, which I didn't know about either (and Chrome's irregexp, which I did).
- ahp 12y agoMight somebody be willing to explain the difference between the two versions? > using HHVM from GitHub rather than our internal repository.
- swtaarrs 12y agoThe only differences are some Facebook-only extensions we use to interface with internal services, and a different build system. The code is exactly the same otherwise.
- johnbolts 12y agogood
- riquito 12y agoThe results would have been very interesting if they switched from PHP 5.6, but switching from 5.3 to HHVM is impossible to know how much of the improvements are due to the newer PHP and how much to HHVM. Nevertheless, Wikimedia must be really satisfied.
- yc1010 12y agoI would love to use hhvm, unfortunately my IDE of choice PHPStorm doesn't support it yet :( despite a big long list of customers requesting it. https://youtrack.jetbrains.com/issue/WI-21737 https://youtrack.jetbrains.com/issue/WI-21737 What editor do Facebook and Wikipedia use for their HHVM/PHP development out of interest? edit: downvoted? really? for what?
- bd808 12y agoI use vim. Other MediaWiki developers use emacs, PHPStorm, TextMate, Notepad++ or whatever editor or IDE the individual developer is most comfortable with.