What are some good PHP performance tips?

前端 未结 13 1763
挽巷
挽巷 2020-12-24 07:55

I\'ve heard of some performance tips for PHP such as using strtr() over str_replace() over preg_replace() depending on the situation.

13条回答
  •  温柔的废话
    2020-12-24 08:21

    If you're looking for good tips on how to program your code so that it's the most efficient, refer to http://www.phpbench.com/. They show a lot of comparisons on various aspects of programming so you can utilize the best methods that fit your needs. Generally it comes down to whether you're looking to save on processing power or memory usage.

    http://talks.php.net/show/digg/0 - A talk given by PHP themselves on performance

    http://code.google.com/speed/articles/optimizing-php.html - Recommendations by Google on how to speed up your applications

    Most commonly your problems aren't with PHP, but are going to be MySQL or http requests issues.

提交回复
热议问题