5 ms·
Why not simply using hiphop-php ? This is what empowers facebook and seem pretty neat https://github.com/facebook/hiphop-php https://github.com/facebook/hiphop-
by gfalcao 14y ago
Why not simply using hiphop-php ? This is what empowers facebook and seem pretty neat https://github.com/facebook/hiphop-php https://github.com/facebook/hiphop-php
- pestaa 14y ago"Simply using" and "hiphop"? An opcode cache is used "simply", whereas a php-to-c++ compiler is not.
- lacksconfidence 14y agoAs mentioned elsewhere in the thread, hiphop is a name of a project, its not just a php-to-c++ compiler. hphp was a program built from hiphop that compiled php to c++. This is being completely ripped out of hiphop. hhvm is also built from the hiphop source. It is a JIT for php, and currently the main focus of the hiphop project. The rest is still of course true, you cant just switch to hiphop it supports an incomplete set of php which is enough for facebook, but not the average library that you want to import via composer(also doesnt support composer, due to no namespaces yet).
- akx 14y agoHipHop works with a certain subset of PHP, whereas Zend Optimizer+ / APC / what-have-you works with it all. In addition switching to HipHop is far more involved than optimizer modules like this. In my experience (back in the dreary days when I did PHP stuff) installing APC took just one apt-get and a restart of the web server for instant gains.
- guywhohatesphp 14y agoImagine having a job working at a company programming in a language you don't understand and are incapable of writing beautiful code in [shudders]. I'm sure the PHP community will miss you.
- velodrome 14y agoExcept it is not that easy. PHP magic is not supported, they are usually a version or two behind, and not all modules are supported. Adding the opcode cache to core will help get more eyes on the code. This should have happened sooner.
- mootothemax 14y agoWhy not simply using hiphop-php ? Try using HipHop before using the word "simple." Take it from me, as someone who's been playing with it inside of the last 72 hours, it's not an instant plug-in option, and it's absolutely not simple. You're compiling PHP scripts to C++, and if you use any non-standard modules, you're going to be in for some fun. This option is simple: it's a plug-in module, just like APC, and it requires very little setup or configuration. If you're going from using nothing to using Zend Optimizer+, you should be blown away by the difference it makes.
- mjs 14y agoWhat version are you using? HHVM (with JIT) is the successor to HPHPc (the version that has the C++ intermediate stage), and is faster. See http://www.facebook.com/note.php?note_id=10150415177928920 http://www.facebook.com/note.php?note_id=10150415177928920
- mootothemax 14y agoI was playing with HHVM, given quite how much FB emphasize not to even try with HPHPc ;-)
- thelarry 14y agoAt what sort of scale do you really need to switch from php to hip hop?
- mootothemax 14y agoAt what sort of scale do you really need to switch from php to hip hop? Honestly, I think that's a bit of a "how long is a piece of string" question. First step is to do zero scaling. As users come on board and you start hitting performance issues, work out where your problems lie - the database or filesystem rather than your code - and optimize for that. Let's not forget the classic one either: your server might just be underpowered or lacking in RAM. Once you get into significant numbers of users or usage, it'll quickly become apparent where the bottlenecks lie, and you should optimize as appropriate. So going back to your question: when PHP becomes the bottleneck.