| Author |
Message |
fkelly Moderator

Joined: Aug 30, 2005 Posts: 3186 Location: near Albany NY
|
Posted:
Wed Feb 03, 2010 7:01 am |
|
See this link:
Basically what it says is that Facebook is written in PHP and has performance issues as a result and they've figured out a way to convert the PHP code to C++ ... the product that does it is known as HipHop and is available Open Source. |
|
|
|
 |
eldorado Involved


Joined: Sep 10, 2008 Posts: 414 Location: France,Translator
|
Posted:
Wed Feb 03, 2010 11:14 am |
|
i was just about to ask about this.
I'm not a c++ hater , but I don't like compiled code |
|
|
|
 |
fkelly Moderator

Joined: Aug 30, 2005 Posts: 3186 Location: near Albany NY
|
Posted:
Wed Feb 03, 2010 1:42 pm |
|
I'm not sure what "liking" or "not liking" compiled code has to do with it. I don't have time to investigate this but I'd guess there's a bunch of gotchas that would have to be overcome ... like they mention that (understandably) the php eval statement won't work. If there was some automatic, reliable and easy way to point a compiler at the top level directory for a distribution and have it create something that would improve efficiency significantly what is there not to like? Of course this would only work on a relatively stable distribution where you are not changing code frequently.
It's really an academic discussion anyway ... I just thought it was interesting to find out that Facebook was written in PHP and why and to see what they are doing to deal with the practicalities of millions of users. It's also kind of cool that they are contributing this back as Open Source, though they may not have had an alternative. |
|
|
|
 |
kguske Site Admin

Joined: Jun 04, 2004 Posts: 6044
|
Posted:
Wed Feb 03, 2010 8:18 pm |
|
Funny, I submitted a news story about it here before reading this post.
It seems to minify PHP in ways similar to the way PHP Minify improves JS and CSS.
Just to clarify: they don't say eval won't work - just that they don't optimize it.
That said, I absolutely agree with fkelly's assessment: it's very interesting to see how FB (Facebook, not PHP-Nuke's original "author"!) deals with performance issues. And yes, it is pretty cool that they're making this available for others to use as well. |
|
|
|
 |
montego Site Admin

Joined: Aug 29, 2004 Posts: 9136 Location: Arizona
|
Posted:
Fri Feb 05, 2010 6:54 am |
|
Yeah, fascinating idea. I have often thought it would be nice to have a natively compiled and executed system for PHP like I've seen others do for Java. |
|
|
|
 |
Gremmie Former Moderator in Good Standing

Joined: Apr 06, 2006 Posts: 2415 Location: Iowa, USA
|
Posted:
Fri Feb 05, 2010 2:38 pm |
|
Most web applications are I/O bound. Apparently Facebook has optimized its I/O delivery system so much that it actually makes sense for them to tackle CPU utilization, and they can actually see a benefit by taking this somewhat drastic action.
There's a reason most web applications are written in interpreted languages like Perl, Python, Ruby, or PHP. Unless you are Facebook, they are good enough for 99% of the sites out there. Otherwise we'd all be using C or C++ to build web apps.
Oh, and hi guys. Hope everyone is doing well. |
|
|
|
 |
kguske Site Admin

Joined: Jun 04, 2004 Posts: 6044
|
Posted:
Fri Feb 05, 2010 2:42 pm |
|
Yes, @ 100 million pages per week, it probably makes sense for them to look at any possible way to improve performance...
Nice to see you, Gremmie! Hope you are well, too! |
|
|
|
 |
jakec Site Admin

Joined: Feb 06, 2006 Posts: 3038 Location: United Kingdom
|
Posted:
Fri Feb 05, 2010 2:46 pm |
|
Hi Gremmie, long time no speak.  |
|
|
|
 |
Gremmie Former Moderator in Good Standing

Joined: Apr 06, 2006 Posts: 2415 Location: Iowa, USA
|
Posted:
Sat Feb 06, 2010 12:11 pm |
|
I haven't tried this, but if I were to want to do a web app in C++, I'd check out this framework:
It is apparently influenced by , which is what I am developing in these days. |
|
|
|
 |
|
|
|
|