It seems that Facebook has been picking up speed since the implementation of a new PHP compiler, with reports indicating as much as an 80% speed increase.
Word of the new, internally developed PHP compiler comes via ReadWriteWeb, which indicates that Facebook has “rewritten the PHP runtime from scratch,” resulting in that nice 80% bump. While all of this is still technically unofficial, it’s been confirmed by a fairly wide array of different sources, so it’s being treated as “all but announced” for now.
The whole thing might be a little foreign to those who aren’t familiar with the ins-and-outs of PHP. The reason a new compiler makes such a big difference is that PHP is an interpreted language, which basically means that every time a user views the page, there’s some calculation on the server side to take that code, interpret it and then spit out the page that the user is looking for.
The folks from ReadWriteWeb managed to get a quite from OpenDNS’s Richard Crowley, who said of the new compiler,
“Compiling PHP to code a CPU can directly execute certainly has performance implications. It would be silly to alter the workflow to be more like C or C++ by doing all parsing and compilation ahead of time. At the other end of the spectrum, it’s slow and out-of-fashion to interpret every statement within the runtime. A JIT (Just In Time) compiler compiles frequently executed portions of the program to machine code for speed while maintaining the flexibility of interpreted code.”
If that was over anyone else’s head then I guess we’re all in the same boat there, but the upshot of all of this is that we can expect Facebook to start behaving an awful lot more quickly.