Hacker News new | past | comments | ask | show | jobs | submit login
PHP Performance Tips from Stanislav Malyshev (php100.wordpress.com)
39 points by akirk on July 15, 2009 | hide | past | favorite | 7 comments



Finally a list of tips that I would dare to give to a novice PHP programmer. Leaves out all the micro-optimization noise you find in most other articles.

Stas (who works for Zend) also did a quite nice post about those (in)famous PHP performance tips from Google: http://php100.wordpress.com/2009/06/26/php-performance-googl...


These are good tips but I'm not sure they're novice accessible. Implementing memcached or bytecode cache are non-trivial.(PHP novice but an experienced coder maybe, but when I hear PHP novice I tend to think novice coder in general - my bad)

But this does make a great place to start if your little php site is starting to get more traffic then you dared hope and its time to start dealing with some scaling issues.

If I'm going to give a novice PHP'r tips it would be along the lines of thinking about using a good stable framework.


Adding an opcode cache speeds things up, but can expose segfaulting bugs in PHP modules that write to errant pointers and corrupt the cache. One of the features I like in xcache is readonly cache protection, which helps prevent these kind of problems.


A novice developer doesn't really need PHP-specific performance tips.


That realpatch_cache tip is a new one to me. I had never heard of it before. Is there any way to see how full the cache is at the moment? (Or what it contains?)


There's no way to currently inspect the cache, without tapping into the internal PHP API as far as I know. I wonder how difficult it would be to create a PECL package to extend it or if it's necessary at all to care about what's inside of the cache. RAM is cheap, so boosting it up should be all you need to care about.

For setting the .ini setting though, check out http://www.php.net/ini.core#ini.sect.performance


That's a pity. RAM is not a problem, but it's more "by how much should I increase it?" :-)

Thanks for your response, though.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: