5

I am just wondering what the best way to optimize PHP code is. Is there any way to compress PHP files, or would removing all of the white space improve performance. Any ways to improve performance in PHP files besides just the way you are writing functions?

1 Answer 1

9

If you are running on Apache, you can use eAccelerator, which will cache the compiled and optimized bytecode produced by the PHP parser, effectively removing the parsing step after the first hit to each script. On my blog's Wordpress install, this halves (!) the loading time of each page.

If you are trying to optimize the actual running time of your script, you will have to follow the standard wisdom: profile your code, find the bottlenecks, optimize them somehow, and repeat until the script is as fast as you need it to be.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.