4 ms·
Oddly, it was that realization -- more than all the other many nits people pick with PHP -- that started making me want to claw my eyes out when I thought about
by chipotle_coyote 12y ago
Oddly, it was that realization -- more than all the other many nits people pick with PHP -- that started making me want to claw my eyes out when I thought about PHP.
PHP has come a long way in many respects, but it's still fundamentally wedded to a 1999, CGI-ish model of the web: pages are fundamentally static entities that you add dynamic bits to as needed. It's a "template engine" because it's basically designed to embed scripts that we would have previously stuck in /cgi-bin right in your web pages. In that world, PHP was pretty awesome.
But in a world of MVC frameworks, "every request starts fresh" means that on every request, the entire framework starts from scratch. It loads libraries and configuration files and ORMs and controller routing on startup -- and it has to do it every single time. Yes, I know things can be and are cached, precompiled, lazily loaded, etc., but that can't completely overcome that. From what I've gathered over the years, PHP is a pretty fast language -- but PHP frameworks consistently get their asses kicked in benchmarks, and I can't help but suspect there's a correlation.
- Iftheshoefits 12y agoRails consistently under performs Django, and both under perform HHVM, go, Java, and C++ frameworks. Benchmarks don't seem to be as important as the perceived social status of a language.