SUSE Conversations


PHP Developer Tips



By: mendesdomnic

October 3, 2008 5:01 am

Reads:181

Comments:0

Rating:0

+Do not use functions inside of for loop, such as for ($x=0; $x < count($array); $x) The count() function gets called each time.

+Profile your code. A profiler shows you, which parts of your code consumes how many time. The Xdebug debugger already contains a profiler. Profiling shows you the bottlenecks in overview

+mod_gzip which is available as an Apache module compresses your data on the fly and can reduce the data to transfer up to 80%

+It’s better to use switch statements than multi if, else if, statements.

+Unset your variables to free memory, especially large arrays.

+Turn on apache’s mod_deflate

+Close your database connections when you’re done with them

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)

Tags:
Categories: Enterprise Linux, Technical Solutions

Disclaimer: As with everything else at SUSE Conversations, this content is definitely not supported by SUSE (so don't even think of calling Support if you try something and it blows up).  It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.

Comment

RSS