Slashdot Mirror


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

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."

39 comments

  1. CLI doesn't by Anonymous Coward · · Score: 1

    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 ).

    1. Re:CLI doesn't by Zero__Kelvin · · Score: 1

      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.

      --
      Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
  2. Re:But, it's all still PHP by Zero__Kelvin · · Score: 3, Informative

    Probably because changing which compiler version you use, etc. and changing it requires s few hours to a couple days at most, while re-writing an entire application in different language will take much, much longer.

    --
    Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
  3. It's good to have options by h33t+l4x0r · · Score: 1

    A faster Wordpress runtime sounds great, but realistically, people generally stack benchmarks to prove what they wanted to prove in the first place.

  4. Not relevant by Aethedor · · Score: 4, Insightful

    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.

    --
    It doesn't have to be like this. All we need to do is make sure we keep talking.
    1. Re:Not relevant by Zero__Kelvin · · Score: 2

      "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 change that would allow them to be PHP Compatible while breaking all software that follows the standard, except Facebook's PHP. Did you think there is something magically differentilicious* about Facebooks PHP code base?

      * My new favorite, and newly coined, portmanteau, meaning deliciously different.

      --
      Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
    2. Re:Not relevant by h33t+l4x0r · · Score: 1

      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?

    3. Re:Not relevant by findoutmoretoday · · Score: 1

      You're not committed, they're not committed, where is the deal.

    4. Re:Not relevant by zidium · · Score: 3, Insightful

      They are the only organization to create a PHP specification in over 20 years of PHP's history.

      If anything, I would say they're far more committed to PHP than Zend ever was or PHP's new overlords, Rogue Wave.

      --
      Slashdot Valentines Beta Massacre: iT WORKED! The boycotts killed Beta!!
    5. Re: Not relevant by Anonymous Coward · · Score: 1

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

    6. Re:Not relevant by Anonymous Coward · · Score: 0

      I cannot imagine a change that would allow them to be PHP Compatible while breaking all software that follows the standard, except Facebook's PHP.

      Er, wut? If they were going to break compatibility with other people's code, then obviously they wouldn't be "PHP Compatible".

    7. Re:Not relevant by Grishnakh · · Score: 1

      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.

    8. Re:Not relevant by Zero__Kelvin · · Score: 1

      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 no reason to believe there is a conspiracy here, or that they could even pull one off if they tried.

      --
      Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
  5. PHP 7 is faster than HHVM by Anonymous Coward · · Score: 5, Interesting

    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.)

    1. Re:PHP 7 is faster than HHVM by Anonymous Coward · · Score: 0

      Microservice architecture framework? Dispensing with VC buzzwords for a moment, what are we really talking about here.. A LAMP stack on docker?

    2. Re:PHP 7 is faster than HHVM by Anonymous Coward · · Score: 0

      Microservice architecture framework? Dispensing with VC buzzwords for a moment, what are we really talking about here.. A LAMP stack on docker?

      Oh come on, how else do you get VC's to part with money for an over-engineered version of something that a 12 year old could write in a weekend?

    3. Re:PHP 7 is faster than HHVM by bohdankolecek · · Score: 1

      Not really. We do not use Apache. Our API gateway and microservices act directly as HTTP server listening on the port 80, employing the reactor pattern implemented in PHP. See ReactPHP or Icicle.io. We do not use MySQL, currently our data are stored in PostgreSQL, REDIS and Amazon S3. See Microservices architecture and Model for large applications for architectural details.

    4. Re:PHP 7 is faster than HHVM by fred87 · · Score: 1
      Hi, I'm https://github.com/fredemmott, on FB's HHVM open source team, and primary author of https://github.com/hhvm/oss-pe...

      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.

    5. Re:PHP 7 is faster than HHVM by bohdankolecek · · Score: 1

      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.

  6. Re:But, it's all still PHP by lucm · · Score: 1

    re-writing an entire application in different language will take much, much longer.

    Agreed. It's especially true when you move from PHP to pretty much any other language, which typically involves a lot more lines of code. Unless you're switching to node and a large chunk of your app overlaps express features (routing, etc.).

    --
    lucm, indeed.
  7. Resource usage? by alantus · · Score: 1

    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?

  8. Still PHP by Anonymous Coward · · Score: 0

    Still PHP, still shit.

    But at least it isn't invisible.

  9. Facebook by Max_W · · Score: 2

    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?

    1. Re:Facebook by fred87 · · Score: 1
      Hi, I'm https://github.com/fredemmott 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 selling it

      * my job, and the job of the rest of the team, is to make HHVM better for people who aren't Facebook (Wikipedia, Baidu, Etsy, and everyone else who uses it). Facebook pays us full-time for this.

  10. Hacking wordpress is even faster! by ilsaloving · · Score: 1

    Oh good! Now Wordpress can be compromised even faster than before!

  11. No Windows build because... by Anonymous Coward · · Score: 0

    https://gist.github.com/Orvid/5c9bc8c54e960a604968

    This is just ROFL, kids these days..., using all the fancy pancy c++ extrensions. I've had my fair share of compatibility problems between gcc and msvc, but none of those were so serious which could not be fixed in an instant, once you know which compiler does not like what.

  12. Re: But, it's all still PHP by binarylarry · · Score: 1

    It's like watching two retarded kids compete.

    --
    Mod me down, my New Earth Global Warmingist friends!
  13. Relative performance also interesting by Zaiff+Urgulbunger · · Score: 2
    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?

    1. Re:Relative performance also interesting by Zaiff+Urgulbunger · · Score: 1

      ..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?

  14. Comment removed by account_deleted · · Score: 2

    Comment removed based on user account deletion

  15. HHVM loses in usabilty. Big time. by Qbertino · · Score: 1

    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.

    --
    We suffer more in our imagination than in reality. - Seneca
  16. Re:Enough! Stop the PHP "hack language" stuff by fatwater · · Score: 1

    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."

    http://hacklang.org/

  17. Re:Enough! Stop the PHP "hack language" stuff by Grishnakh · · Score: 1

    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, with that kind of code is that only that one guy knows how it works and can work with it. It's not maintainable at all.

  18. Re:Enough! Stop the PHP "hack language" stuff by Anonymous Coward · · Score: 0

    > It's entirely possible to make very high-performing and reliable code that looks like total shit like that

    Yes, but performance is not the only goal of high-level programming languages.

    Remember that a program is a text designed to let a *person* create and modify instructions to a computer. It's a form of communication from person-to-computer but also person-to-person.

  19. Re:Enough! Stop the PHP "hack language" stuff by Grishnakh · · Score: 1

    Yes, I think I addressed that when I pointed out at the end how such code is unmaintainable, because only the original author has any clue how it works. It's also good to make maintainable code because even the original author will forget about it and have trouble working with it after some time. I'd say maintainability is one of the main reasons we have high-level languages (that plus being able to write applications with fewer programmer-hours): back in the old days, it only took one programmer to write a program, but these days we have whole teams of people working together, and team members coming and going periodically, and hacked-together assembly isn't going to work for that.

  20. Re:Enough! Stop the PHP "hack language" stuff by Anonymous Coward · · Score: 0

    So PHP isn't a hack language because someone you once knew who only knew 80s style programming patterns and practices once wrote terrible code?

    You're not really selling your argument very well.

  21. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  22. Re:Enough! Stop the PHP "hack language" stuff by fred87 · · Score: 1