Facebook HipHop virtual machine for PHP?

后端 未结 2 1184
逝去的感伤
逝去的感伤 2021-01-15 02:59

I\'ve looked at this article- HipHop PHP (was Hyper PHP by Facebook)

However, recently come across this Facebook Speeds Development With “HipHop Virtual Machine”, A

相关标签:
2条回答
  • 2021-01-15 03:47

    You can find the details in the article linked in the article you linked:

    • https://www.facebook.com/notes/facebook-engineering/the-hiphop-virtual-machine/10150415177928920

    hphpc is in essence a traditional static compiler that converts PHP→AST→C++→x64. We have long been keenly aware of the limitations to static analysis imposed by such a dynamic language as PHP, not to mention the risks inherent in developing software with hphpi and deploying with hphpc. Our experiences with hphpc led us to start experimenting with dynamic translation to native machine code, also known as just-in-time (JIT) compilation. A dynamic translator can observe data types as the program executes, and generate type-specialized machine code.

    The type-specialized machine code runs faster. Unless you are the size of FB, you do not need this. Use APC or memcached and more traditional approaches to scaling out.

    0 讨论(0)
  • 2021-01-15 03:50

    The other answer about HPHPC is accurate... the performance boost is quite nice, but only if you actually need it enough that it's worth the extra complexity.

    I'd suggest waiting a few weeks or even months before looking into HPHPVM. It's looking promising, but it's still in the very early stages as far as optimization and bug-fixing go. In the long run it'll probably end up being a great alternative to Zend, but right now the relatively small boost in performance (compared to, say, full translated/compiled HipHop) is likely not worth the extra complexity. That said, do check back in a few months.

    0 讨论(0)
提交回复
热议问题