1

i have coded a site in Procedural style in PHP, now to improve performance i need to compile them. I dont hav a good idea on PHP code compilation ! so need some help on how to do it for Procedural style code !

4
  • 2
    Are you sure compilation is the best option for performance improvement? Have you profiled and found that there are no other code changes? Compiling is typically a much later step in optimization. Commented Apr 4, 2011 at 2:33
  • @Tesserex can you tell me the steps to improve performance ! i have done changes to the script from steps i found googling Commented Apr 4, 2011 at 2:39
  • Most Google steps are useless. They tell you things like what type of loop to use, pre-increment vs post, single vs double quotes, etc. Those all give absolutely tiny gains, if anything. Good optimization requires understanding running time analysis of your algorithms (big O mainly.) Find what code sections are taking most of your execution time, and post them here, so we can give you more concrete advice. Commented Apr 4, 2011 at 3:18
  • @Tesserex thnx for the advice :) Commented Apr 4, 2011 at 3:19

1 Answer 1

2

PHP is not a traditionally compiled language. There's the Facebook HipHop PHP C++ compiler/transformer, but you should have very specific reasons before you start using it. The usual way to speed up PHP scripts beyond what can be done by internal optimization is by using opcode caching on the executing server.

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

2 Comments

what is internal optimization ? can you tell me a little bit more ?
@Sourav Make the script work as well as possible. Don't do stupid, time wasting operations. Use data caching if appropriate, etc. etc. Do whatever you need to do in the most efficient manner possible. Then micro-optimize your code. Only if it's still too slow after doing all that, worry about compilation.

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.