Facebook Releases JIT PHP Compiler
angry tapir writes, quoting a Techworld article: "In its continuing endeavor to serve its 800 million users as quickly as possible, Facebook is once again revamping the way it handles its PHP-based Web pages. Facebook has posted ... its HipHop Virtual Machine (HHVM), which the company's engineers call a just-in-time PHP compiler. According to Facebook, this PHP execution engine is 60 percent faster than its current PHP interpreter and uses 90 percent less memory."
Facebook has a weblog post with a more technical description.
I'd like to launch this discussion by making a snide remark about PHP.
Breakfast served all day!
Da Hip Hop PHP compila is in Da House! Respect bitches!
These posts express my own personal views, not those of my employer
That's a step forward for us who rely on crammed share hosting providers, but I strongly believe that PHP has to be phased out in favor of more recent techologies that enforce a clearer (eg DRY, separation of content and logic etc) way of thinking.
Interesting that they've settled on this approach, which in some ways is much more traditional: developing a high-performance JIT for a dynamic language instead of trying to statically compile a subset. Basically the approach taken by StrongTalk, V8, PyPy, Rubinius, etc.
10 PRINT CHR$(205.5+RND(1)); : GOTO 10
The first 90% of the hhvm project is done; now we're on to the second 90% as we make it really shine.
Is FB's JIT PHP open sourced?
Muchas Gracias, Señor Edward Snowden !
And I quote:
What is your problem with this exactly? The functions do exactly what their name suggests. They will either make your head implode or explode!
These posts express my own personal views, not those of my employer
hip hop has been open source for quite a while. At least a year.
They're just not maintainable in my experience.
Can I "Like" this?
The real Sig captains the Northwestern. This one captains
You can find a real PHP compiler at http://phpcompiler.org/. It would be nice if the official PHP engine had built in support for loading and running bytecode ( like JVMs ) instead of strictly text code.
the readme says its a source code transformer that converts php into c++ then compiles it with g++.
How is that a JIT VM in any sense of the word?
Unless I misunderstood the post, this is only being used in their development environments. It sounds like they are still using statically compiled php for production. They did mention that they hoped to closed they gap in performance between the two in the near future though.
'The tyrant will always find pretext for his tyranny.' - Aesop's Fables
I've had a page made for me by a relative for business purposes and since then I visited a few pages on facebook related to my interests/business and I have to say, that I hate Facebook. Facebook is one of the worst pieces of crap I've ever seen. It's so unbelievably unintuitive, obscure and inconvenient (in all aspects, trying to set things for my own page, or looking at other pages, pictures, tehn going back, whatever), that it drives me nuts ever time I visit it (which is not a lot and I intend to keep it that way!)
Those are some very nice performance numbers the Facebook team achieved. Kudos. Time well invested.
One of these days I need to write a compiler for my own stuff. Re-interpreting strings a few thousand times is the next big optimization opportunity I have for my core library. Eliminating that re-parsing should garner a nice performance improvement, though I envision compiling to a set of runtime objects rather than actual bytecode or native Java source. Faster than p-Code or a non-JIT JVM, but not as fast as it could be if I went crazy optimizing things.
I do not fail; I succeed at finding out what does not work.
With all the privacy problems from Facebook, who's to say they didn't add Facebook-cookies tracking code in there, to increase their control over their users from other websites?
They should offer this as a platform to other websites, and developers that want to maintain and leverage the advantages of using this JIT compiler vs the other one....
If they are saying "we just recreated a php that is faster and more performing than the original" I would say yay!!
Facebook could just buy PHP and say it owns the language, if they have enough money, no?
Everytime I log in to FB I lament as to how these guys reached 750 million users (or what are the fake numbers yet?) with such a shitty, lame, mediocre, underperforming and buggy piece'o'crap.
Then I remember it's PHP. Yeah, right.
I'm using freakin' "websites" that are more complex than quite a lot of applications nowadays (no, /. ain't one of them) and the only sure I can be sure of is that they weren't developed by "webdesigners" knowing how to cargo-cult some PHP crap.
Why don't they use (invest in) Quercus on Java instead? Compiles PHP to Java classes (like JSP) and works blazingly fast: http://caucho.com/resin-3.1/doc/quercus.xtp#compiling
I wonder why we don't here more about Quercus in the PHP world...
For some reason I find this image from the last link amusing... could it be the naming convention? Or the combination of a particular function name and argument name?
http://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc7/385994_10150437163692200_9445547199_8439695_1870185023_n.jpg