3 ms·
This is the company that famously runs their main website on ... drum roll ... PHP. I know it's not off-the-shelf PHP, and they do a lot of clever stuff with it
by ein0p 2y ago
This is the company that famously runs their main website on ... drum roll ... PHP. I know it's not off-the-shelf PHP, and they do a lot of clever stuff with it, but to worry about single digit milliseconds when you have such a barnacle as the centerpiece of your business is hilarious.
- tekknolagi 2y agoThey are extraordinarily different languages and runtime systems.
- summerlight 2y agoI think most of their performance critical infrastructures are written in native languages like C++ and even their PHP (actually Hack) parts are significantly modified and optimized.
- woadwarrior01 2y agoHack superficially looks like PHP, but is a completely different beast under the hood.
- toast0 2y agoI know it's popular to hate on PHP. But when you do it right, you can turn pages out fast enough that single digit milliseconds are important. I'm not a fan of Hack or how FB structures their PHP; but some of their pages are pretty quick. Personally, with just regular PHP, my baseline is about 10 ms for a minimum page, and 50 ms for something that's complex and maybe has a few database queries. That's not the quickest thing in the world, and not all of my PHP goes that fast, but single digit milliseconds are still significant at that scale.
- yuliyp 2y agoHHVM is an amazingly-optimized VM for their workload. That PHP runs many times faster than off-the-shelf PHP does. I suspect taking any other widely available VM and waving a magic wand to rewrite in another language would result in something that performed significantly worse.
- pjmlp 2y agoNot only is HHVM much more faster than the earlier HipHop C++ compiler attempt, they also have enough C++ and Rust, alongside some less mainstream ones like Haskell and Erlang. https://engineering.fb.com/2022/07/27/developer-tools/programming-languages-endorsed-for-server-side-use-at-meta/ https://engineering.fb.com/2022/07/27/developer-tools/progra...
- paxys 2y agoThere is no PHP at Facebook/Meta
- metastasis24 2y agoHack is a rather absurd local maxima language, but the journey there makes sense. Circa 2005, PHP was a reasonable choice for quickly iterating on a website. The language was quite amateurish, but it's a web-first language, and its edit-and-refresh development loop was better than most languages. At some point, two things happened. Any change to code, especially heavily used code, became risky because of limited typechecking, and the scale of the site was large enough that running Zend got expensive. Compiling to C++ with HipHop addressed immediate performance concerns, but it's a fragile solution. At some point, you're faced with either rewriting the codebase in something sensible or migrating in-place with a language fork and a custom VM. Facebook opted to pay the ongoing tax of maintaining its own language and having a team that supports it. An in-house language gives you freedoms like being able to make language changes driven by business needs like privacy, but the language lacks scrutiny of larger community. Some features are half-baked, and it's missing features most popular languages have. PHP 7 cherry picked enough Hack and HHVM features that it's better to stick with PHP. There's no broader support for the language, and it's not clear HHVM is still faster. The next time you're involved in language bikeshedding, remember that Facebook went all-in on PHP, and it was a good-enough choice.