Welcome to WebmasterWorld Guest from 54.159.50.111

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Got a PHP performance tuning tip?

     
5:41 am on May 10, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Nov 15, 2004
posts:1867
votes: 0


PHP performance tunning tips. Please add to the list.

1. Reduce the number of connections to the DB.
2. Use (for and while) loops wisely
3. Anybody?

Hab

8:21 am on May 30, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Nov 15, 2004
posts:1867
votes: 0


arrays vs a number of variables to hold data? What is the speed difference?

Hab

4:23 pm on May 30, 2006 (gmt 0)

Administrator

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 24, 2001
posts:15755
votes: 0


I think that would really depend on what you are doing with them. At some point in the eqation there would also be 'ease of use'.
5:17 pm on May 30, 2006 (gmt 0)

Preferred Member

10+ Year Member

joined:Apr 30, 2005
posts:515
votes: 0


The biggest speedup I obtained was from reducing the number of "includes" and "requires".
Each one of these is a physical disk access, and whilst a good caching and optimizing module can help, I still realized huge parse time decreases by getting rid of as many of these as possible.

Far more significant than worrying about relatively inconsequential things like single vs double quotes for example.

5:20 pm on May 30, 2006 (gmt 0)

Preferred Member

10+ Year Member

joined:Apr 30, 2005
posts:515
votes: 0


Next on my list would be optimizing your database - using indexes and making sure your queries use them. Benchmark long running queries to see if they can be rewritten. Never assume that even a relatively simple query can't be improved.

Turning on the query cache helps, too, if you are using MySQL, and making sure the database configuaration parameters are optimized for your particular situation.

4:29 pm on June 8, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:Sept 2, 2004
posts:187
votes: 0


Is there any time savings with alternative syntax? Anyone done any testing? Is there a good site to see these type of test results?
This 35 message thread spans 2 pages: 35