Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!


Forgot your password?
Check out the new SourceForge HTML5 internet speed test! No Flash necessary and runs on all devices. ×
PHP Programming

HHVM Beats Stable Version of PHP 7.0 In Recent Benchmark (kinsta.com) 39

campuscodi writes: PHP7 and HHVM have been exchanging punches for a while via benchmarks. While the PHP supporters were always saying, just wait until the stable version comes out, well... the stable version is out, and a recent benchmark reveals that "HHVM beats PHP7.0 hands down." Compared on: WordPress, Magento, Drupal8, Laravel, PyroCMS, and October CMS. You can still be a "PHP supporter" and favor HHVM, which "serves as an execution engine for the PHP and Hack programming languages."
This discussion has been archived. No new comments can be posted.

HHVM Beats Stable Version of PHP 7.0 In Recent Benchmark

Comments Filter:
  • by Anonymous Coward

    HHVM beats PHP7 hands down, *except* when it comes to CLI interface and PHP scripting: in that scenario HHVM sucks really hard, like 300% slower than PHP7.

    HHVM beats PHP7 only in some given scenario, and that's not without glitches (it still can't play properly with upload_max_size and some ini_get... https://github.com/facebook/hhvm/issues/4993 ).

    • Your link is to an issue that has been resolved actually. It still shows as open, but in the comments section they have a fix in place. It seems like the issue just wasn't closed properly.
  • A faster Wordpress runtime sounds great, but realistically, people generally stack benchmarks to prove what they wanted to prove in the first place.
  • Not relevant (Score:5, Insightful)

    by Aethedor ( 973725 ) on Saturday December 12, 2015 @05:29AM (#51104225) Homepage

    I don't care about these results, for the simple fact that nothing guarantees that Facebook won't make any changes to HHVM in the future that is beneficial for Facebook, but adverse for all other PHP based webapplications. PHP 5 is fast enough for me. PHP 7 being significantly faster is more than good enough.

    • "for the simple fact that nothing guarantees that Facebook won't make any changes to HHVM in the future that is beneficial for Facebook, but adverse for all other PHP based webapplications"

      You mean other than the fact that they probably couldn't do that even if they set out to do so intentionally and hired a team of Engineers to spend years trying to do it. I'm curious, just exactly how you think this is even possible? HHVM either supports PHP or it doesn't (turns out it does) and I cannot imagine a chan

      • by Anonymous Coward

        Because Microsoft didn't build an empire doing exactly that.... Embrace, extend, extinguish anybody.

      • WTF? Why makes you think they have some sort of obligation to be PHP compatible, and not make their own, slightly-incompatible version of PHP? That's exactly what Microsoft did with J++ after all. If it suits them to make their own version of PHP, there's nothing to stop them.

        • Nothing stops them from changing hhvm from what it is (a PHP tool) to something else, but then at that point that is the equivalent of saying HHVM used to be a PHP tool, but now something else. Facebook no longer makes a PHP compatible HHVM after version x.y Of course x.y will still work so you can keep using that version unless your needs grow in a way that requires to change. If that happens, changing back to regular old PHP is always an option. I despise Schmuckerberg and hate Facebook, but there is
    • If you were to switch, and that happened, you could just switch back. You're not committed for life, dude, so what's the big deal?
  • by Anonymous Coward on Saturday December 12, 2015 @06:14AM (#51104313)

    In our company we have developed HTTP/REST based microservice architecture framework written in PHP, and our performance tests show that PHP 7 is much faster than HHVM:

    PHP 5.6.13 - performance about 400 requests/second
    HHVM 3.10 - performance about 600 requests/second
    PHP 7.0.0 - performance about 750 requests/second

    In addition with PHP 7 we avoid many compatibility issues with 3rd party extensions not or badly supported on HHVM. Consequently HHVM is going to be obsolete after PHP 7 stabilises a bit.

    (I have also deployed PHP 7 on some Magento eshops and the performance gain is terrific compared to PHP 5.6.)

    • by fred87 ( 720738 )
      Hi, I'm https://github.com/fredemmott [github.com], on FB's HHVM open source team, and primary author of https://github.com/hhvm/oss-pe... [github.com]

      Optimizing: have you tried using hhbc/repo-auth-mode? This can gets you tens of percents, though isn't compatible with all code. Additionally, are you excluding JIT warm-up time?

      Standard disclaimer: we are not faster at everyone's code. In particular, PHP tends to be faster if you have a load of code just in files, but not in functions/methods.

      • JIT warm-up was is taken into account, i.e. test results were discarded until HHVM performance peaked.

        Benchmarked PHP scripts are daemons, thus repository authoritative mode would not affect the performance, except of the first request.

        The code is object-oriented, consisting of many layers, each split into small testable methods. The benchmarked scripts were basically reading and writing socket streams, transforming data between JSON and MsgPack and reporting its status into Redis database.

  • I am more interested in resource usage than performance, since I use PHP to provide a GUI for embedded devices.
    Anybody knows of a good benchmark between PHP 5, PHP 6, PHP 7 and HHVM in this area?

  • by Max_W ( 812974 ) on Saturday December 12, 2015 @08:54AM (#51104563)
    As far as I know the Facebook is behind the HHVM. This alone makes me suspicious of perspectives. Will not HHVM start showing ads in future? Or offer a full version of the HHVM for a great price?
    • by fred87 ( 720738 )
      Hi, I'm https://github.com/fredemmott [github.com] and I work on Facebook's HHVM Open-Source team*.
      • - we're open source (under the same licences as PHP itself). If we start showing ads, delete the code. If we stop being open source, fork it with the help of the other major companies using it
      • - same story for trying to move extensions to a "full" version
      • - HHVM gets us more from the benefits of open source (contributions, recruiting, new hires being familiar with our code, etc) than we could reasonably expect to get by s
  • Oh good! Now Wordpress can be compromised even faster than before!

  • by Zaiff Urgulbunger ( 591514 ) on Saturday December 12, 2015 @12:59PM (#51105509)
    Ignoring HHVM and just focusing on PHP 7 vs. CMS and Frameworks, the results were:
    1. Laravel 5.1.11 / PHP 7: 1363.24 trans/sec
    2. Drupal 8.0.1 / PHP 7: 917.10 trans/sec
    3. October CMS / PHP 7: 407.89 trans/sec
    4. WordPress 3.4.1 / PHP 7: 306.24 trans/sec
    5. WordPress 4.4 / PHP 7: 287.92 trans/sec
    6. Magneto 2.0 CE / PHP 7: 183.87 trans/sec
    7. PyroCMS v3 b2 / PHP 7: 145.95 trans/sec

    I assume Laravel is using static content here hence it's performance, but I'm intrigued at Drupal's performance compared with October and WordPress. Is this because Drupal's sample site is simpler and had less to do, or because Drupal is better optimised/cached?

    • ..also, forgot to mention, WordPress 4.4 is noticeably worse than WordPress 3.4.1 which is unfortunate. Maybe the router handling the REST API stuff has more work to do now?
  • by yayoubetcha ( 893774 ) on Saturday December 12, 2015 @01:07PM (#51105571)

    In the hands of a hacker, slacker, whacker, whatever, all languages are crap in the hands of the right (wrong) programmer.

    The first programmer I knew who retired early with his financial success in the mid-80s was also the worst C language hacker I ever knew. He was a long-time Assembly language programmer who carried his "assembly style" into C. It was the worst C code I have seen before or since. It was littered with GOTOs and variable names seem to be limited to two or three characters. And, no functions just one super large "main()" where he coded his word processor for the IBM-PC.

    It's not the language, it's the coder that makes a language a 'hack' language.

    • by fatwater ( 10927 )

      I get your dislike of how many here hate PHP, but I think "Hack programming languages" is referring to this:

      "Hack is a programming language for HHVM. Hack reconciles the fast development cycle of a dynamically typed language with the discipline provided by static typing, while adding many features commonly found in other modern programming languages."


    • Yeah, but how well did his C code work?

      It's entirely possible to make very high-performing and reliable code that looks like total shit like that, and I can certainly see a long-time highly-competent assembly programmer doing just that in the days before modern programming languages and styles. Go look at all those old arcade and NES games; the binaries are absolutely tiny, and I can only imagine what the code looks like (probably all assembly), but you never saw those things "crash".

      The problem, of course

      • His program performed extremely well and 99% bug free (but that last one percent was never fixed!). He worked as a paid consultant for Data General for two more years trying to get the last of his bugs fixed. He asked me if I wanted the $50/hour (mid-80s dollars) contract. That's when I said I need to see the code first. It was hideous and I declined.

        In the end, DG ate the million+ dollars they paid for it and scuttled it. This programmer originally had great success with one of the best word processin

    • by fred87 ( 720738 )
      Have you seen https://docs.hhvm.com/hack/ove... [hhvm.com] ? :)
  • HHVM is an improvement for FB, because they have a small army maintaining their Pipeline and save 40% of their Servers using Hack and HHVM. For regulÃr Php szenarious hhvm is utterly pointless. I'll trust the zend engine for all that stuff, thank you.

The less time planning, the more time programming.