问题描述
切换到HipHop而不是XCache是否有意义?
Would it make sense to switch to HipHop instead of XCache?
HipHop准备好迎接黄金时段了吗,还是我们应该等待几个月才能实施?
Is HipHop ready for primetime or should we wait several months before implementing it?
我们很有趣地在运行vBulletin的服务器上测试配置.
we are interesting in testing the configuration on a server running vBulletin.
推荐答案
让我澄清一下您对Hiphop和Xcache的误解. XCache通过将操作码缓存添加到ZEND的PHP实现中(例如APC和朋友)来工作,而Facebook的HipHop则允许将PHP代码转换为C ++代码,然后使用g ++进行编译.不可能在HipHop上运行XCache,因为HipHop不依赖于Zend解释器(并且甚至不使用php操作码,因为它在转换为C ++之后被编译为字节码).
Let me clear up a misconception you might have about Hiphop and Xcache. XCache works by adding Opcode caching to ZEND's PHP implementation (like APC and friends), while Facebook's HipHop allows for PHP code to be transformed into C++ code and then compiled using g++. It's not possible to run XCache with HipHop as HipHop doesn't depend on Zend interpreter (and doesn't even use php opcodes as it's compiled to bytecode after transformed to C++).
现在可以回答您的问题,HipHop被实时用于承载大量Facebook流量.如果该项目不稳定,Facebook不会发布该项目,但是由于它是一个非常新的项目,因此我仍要谨慎行事. HipHop不仅是旧版Zend Interpreter的补丁,它是一种完全不同的运行PHP代码的方式,并且其中可能包含一些错误.
Now to answer your question, HipHop is being used live to host a large amount of Facebook's traffic. Facebook wouldn't release this project if it wasn't near stable, but since it is very new I would still exercise caution. HipHop is not just a patch to the old Zend Interpreter, it is a completely different way to run the PHP code and will probably have a few bugs in it.
Facebook在确保Hiphop切换到该功能之前所做的一件事是,他们能够在其网站上针对每个可能的请求设置非常严格的单元测试.这样,如果Hiphop的输出与普通的Zend PHP不同,它们将返回并调试更多,直到一切为他们工作"为止.仅仅因为它在Facebook代码库上有效"并不能证明它对您的代码有效.如果您决定切换到HipHop,请确保对其进行了良好的测试.
One thing that Facebook did to ensure that Hiphop was working before they switched to it was they were able to setup very rigorous unit tests of each possible request on their site. That way if the output from Hiphop was different from the normal Zend PHP, they would go back and debug some more until everything "worked for them". Just because it "works" on Facebook code base doesn't prove that it'll work for yours. If you do decide to switch to HipHop, make sure to test it well.
HHVM(HPHP的新VM版本)现在可以eval
和create_function
.出于所有/最有意义的原因,它们应该相同.
HHVM (new VM version of HPHP) can now eval
and create_function
. They should be the same for all/most meaningful reasons.
这篇关于用HipHop代替XCache?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!