Unhandled Perception
From the mind of a developer.

Thursday, October 18, 2007

40 Tips for optimizing your php Code

  1. If a method can be static, declare it static. Speed improvement is by a factor of 4.
  2. echo is faster than print.
  3. Use echo's multiple parameters instead of string concatenation.
  4. Set the maxvalue for your for-loops before and not in the loop.
  5. Unset your variables to free memory, especially large arrays.
  6. Avoid magic like __get, __set, __autoload

Plus 34 more at:
http://reinholdweber.com/?p=3

Labels:

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home