Facebook HipHop virtual machine for PHP?
Asked Answered
A

2

2

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 60% Faster PHP Executor

Does anyone have details on this? Is it worth exploring for a PHP developer?

Alcott answered 2/1, 2012 at 4:16 Comment(0)
H
2

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

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.

Heinrike answered 2/1, 2012 at 7:52 Comment(3)
Thanks for the recommendation. I got the same sense but wanted to see what others think about it.Alcott
Would it be possible for you to explain the quoted text in simpler words?Alcott
@startup hmm, not really sure how to phrase it more simple. maybe en.wikipedia.org/wiki/Just-in-time_compilation helps understanding it better?Heinrike
S
1

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.

Shannashannah answered 23/2, 2012 at 7:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.