5 ms·
One way to improve cpu-bound performance is to switch to something like HipHop for PHP [1], which compiles PHP down to C++ and runs that. Granted, this incurs
by mkjones 15y ago
One way to improve cpu-bound performance is to switch to something like HipHop for PHP [1], which compiles PHP down to C++ and runs that. Granted, this incurs a non-trivial switching cost.
However, it's scary to me that someone is suggesting the potentially fatal-inducing use of "require" over "require_once" (if you call it twice on the same file, you end up re-defining whatever classes or methods were required and the script dies). It seems like optimizing for developer time and simplicity over cpu utilization is better here. Using HipHop would incur a one-time operational cost, but I suspect it would be worth the additional developer and speed gains.
[1]: https://github.com/facebook/hiphop-php/wiki/ https://github.com/facebook/hiphop-php/wiki/
- jonhohle 15y agoBy using __autoload and a class/file naming convention, you can get away with using just require, and not having to write require statements manually. Decreased time for developers, and near optimal load times.
- KevBurnsJr 15y agoHPHP is realistically only going to get you like 5% performance bump. Performance Talk by Rasmus Lerdorf http://vimeo.com/12416792 http://vimeo.com/12416792 (skip to 14:30)