Page 1 of 1

Some useful php performance optimization

Posted: Tue Jan 20, 2009 7:15 am
by pjcvijay
I found some useful php performance optimization..... I hope that would help all....

http://www.hm2k.com/posts/50-php-optimi ... -revisited



Thanks,
Vijay

Re: Some useful php performance optimization

Posted: Tue Jan 20, 2009 7:29 am
by jaoudestudios
Very useful, thanks :)

Re: Some useful php performance optimization

Posted: Thu Jan 22, 2009 7:18 pm
by kaisellgren
A typical "do this instead of this".

Real performance does not come from switching your prints to echoes or using ++$a instead of $a++. You should really use the ones you prefer and which are better for the case. Sometimes you need to do post-increment and sometimes pre-increment. If you do it vice versa it becomes more complicated.

Use optimizers, cache static content, make a fast HTML template system, etc and don't try to switch all double quotes to single quotes.

Btw, I once tested switching all double quotes to single quotes. I used WordPress (not 2.7) and I replaced all quotes to single ones. It was not a straight forward replacement, but anyway, I did not notice anything. The random microtime change will hide the performance "gain" I got.

Re: Some useful php performance optimization

Posted: Fri Jan 23, 2009 1:00 am
by arjan.top
they forgot to add "switch to assembly" ...

I think such "optimization tips" are stupid, nano-optimizations that does not matter

Re: Some useful php performance optimization

Posted: Fri Jan 23, 2009 2:16 am
by papa
I think there was some pretty useful tips in there.

#53 should be a sticky in the php code forum :)

Re: Some useful php performance optimization

Posted: Fri Jan 23, 2009 7:25 am
by kaisellgren
papa wrote:I think there was some pretty useful tips in there.

#53 should be a sticky in the php code forum :)
Oh well I guess you are right.

By the way, the site is about optimization so why does it have security related topics?! 8O

Re: Some useful php performance optimization

Posted: Fri Jan 23, 2009 7:27 am
by papa
kaisellgren wrote:
papa wrote:I think there was some pretty useful tips in there.

#53 should be a sticky in the php code forum :)
Oh well I guess you are right.

By the way, the site is about optimization so why does it have security related topics?! 8O
Maybe he got carried away :)

Re: Some useful php performance optimization

Posted: Fri Jan 23, 2009 10:53 am
by Paul Arnold
#24 An alternative caching technique when you have pages that don’t change too frequently is to cache the HTML output of your PHP pages. Try Smarty or Cache Lite. [Citation]

#33 Don’t bother using complex template systems such as Smarty, use the one that’s included in PHP already, see ob_get_contents and extract, and simply pull the data from your database. [Citation]

Re: Some useful php performance optimization

Posted: Fri Jan 23, 2009 11:05 am
by kaisellgren
Paul Arnold wrote:#24 An alternative caching technique when you have pages that don’t change too frequently is to cache the HTML output of your PHP pages. Try Smarty or Cache Lite. [Citation]

#33 Don’t bother using complex template systems such as Smarty, use the one that’s included in PHP already, see ob_get_contents and extract, and simply pull the data from your database. [Citation]
Haha :D