|
PHP: The need for speed
Piergiorgio Spagnolatti
One of the greatest advantages when using PHP is obviously speed. PHP4 is in general
fast enough for dynamic web content generation, and in most cases you can't even think
of anything faster than it. But when you have to face lots of accesses, heavy applications,
narrow bandwidth, or other factors that can create performance bottlenecks, you may ask yourself
if you can do anything to make things work better. In this article I'll explain what you can
do to further improve php performance, and how to make your users' browsing experience even
more pleasant.
First of all, code optimization...
No, I'm not going to tell you again that you have to write clean and clear code, since
everyone knows it, and if you're looking for speed then you probably already tweaked something
in your PHP sources. However, there's something that can do this dirty job for you. It's the
Zend Optimizer, available for free (you have to agree to the Zend Optimizer license, since it's not
released under the GPL) from Zend Technologies
the people that brought us our blazing fast PHP engine). It "simply" goes over the intermediate code generated by
the Zend Engine and optimizes it for faster execution. I said "dirty job" since we all know
that tweaking code sometimes can bring you to unreadable code, and this is not what you want
to find when making changes to your nearly forgotten 3-years-old PHP application... ;-) .
You will notice that complex PHP sources sudden will benefit from Zend Optimizer, so I suggest
you to use it as long as it doesn't produce strange incompatibilites with your code (never found one
though). Installing the Zend Optimizer is really easy. Just download the precompiled library
for your platform, add the following two lines in your php.ini, restart your webserver, and... That's it!
zend_optimizer.optimization_level=15 zend_extension="/path/to/ZendOptimizer.so" zend_loader.enable=Off
Ooops... I said two lines and you find three. In fact the third line is optional, but it seems
that disabling this zend_loader speeds up a bit the Optimizer, so it's worth a line in your php.ini.
Pay attention: you can disable the zend_loader only if you don't use the Zend Encoder Runtime, which
will be discussed later.
[ Next Page ]
| Comments: | ||
| This was closely associated with the rebirth of | Sex Beplaced Ru | 12/06/04 16:31 |
| it tells me i don't have | Sex | 12/06/04 16:29 |
| If not, what were all the witch trials about? | Sex | 12/06/04 16:27 |
| You are right ofcourse... But... | Sex Beplaced Ru | 12/06/04 16:27 |
| freaking BS, I enjoyed the IP | Freeflashonlinegames Com | 12/06/04 16:24 |
| ´ë'Ãâ'°Å'Àý'½Ã'100%µÇ'°Ô'ÇÏ'´Â'¹æ'¹ý | ÇѰæ¿í | 12/05/04 08:43 |
| Ä«/µå/µ¹·Á¸·±â·Î/¸Á°¡Áö½ÅºÐ/²À º¸¼¼¿ä! | ÀÌÇýÁø | 11/24/04 20:35 |
| ´ë'Ãâ'°Å'Àý'½Ã'100%µÇ'°Ô'ÇÏ'´Â'¹æ'¹ý | ÇѰæ¿í | 11/24/04 06:43 |
| ½Å.¿ë.ºÒ.·®.ÀÚ/´çÀÏ500/´ë.Ãâ.ºñ.¹ý | ÀÌÈñÁø | 11/19/04 21:50 |
| 10_ºÐ¾È¿¡ Çö.±Ý40¸¸_¿ø ¸¸.µé,±â | ÀÌÁ¤¿¬ | 11/15/04 08:09 |
| ´ë'Ãâ'°Å'Àý'½Ã'100%µÇ'°Ô'ÇÏ'´Â'¹æ'¹ý | ÇѰæÇý | 11/13/04 04:38 |
| pls help | alin | 10/16/02 08:46 |
| hi im back | zaid | 09/30/02 14:17 |
| RE: persistent variables without sessions | Benjamin Roth | 09/12/02 19:53 |
| Shameless ZEND plug here? | cedric veilleux | 08/23/02 17:42 |
| Having strange W2k Adv Srvr perfomace probs | Jeff Barton | 06/27/02 20:07 |
| RE: What about .js and .css files? | Edward Tsai | 06/26/02 14:58 |
| gzhandler | danbee | 01/22/02 12:22 |
| RE: What about .js and .css files? | sergio | 09/19/01 09:44 |
| persistent variables without sessions | Greg Wallis | 07/17/01 12:18 |
| HELP!how to make my site fast | santosh | 06/23/01 02:16 |
| RE: gzip? | Sean Allin | 06/21/01 12:57 |
| RE: Caching in memory | Hinnerk Bruegmann | 05/29/01 13:51 |
| RE: HELP!!How to limit records in ORACLE? | V. O | 05/09/01 09:03 |
| HELP!!How to limit records in ORACLE? | kaiser | 05/04/01 07:44 |
| RE: Zend optimizer reported in phpinfo but...? | Piergiorgio Spagnolatti | 04/25/01 14:14 |
| Zend optimizer reported in phpinfo but...? | Venkatesh | 04/17/01 04:35 |
| RE: What about .js and .css files? | Piergiorgio Spagnolatti | 04/06/01 02:06 |
| What about .js and .css files? | Len Coonan | 04/02/01 22:06 |
| Re: PHP Need for speed | xcyber | 03/31/01 04:41 |
| Re: PHP Need for speed | Ray | 03/30/01 16:50 |
| RE: gzip? | Piergiorgio Spagnolatti | 03/30/01 07:29 |
| Sending gzipped cached pages. | Jean-Pierre Deckers | 03/27/01 14:35 |
| minimize the "include" function | Joe Shelby | 03/26/01 14:10 |
| RE: mod_gzip 1.3.19.1a | Piergiorgio Spagnolatti | 03/26/01 01:19 |
| RE: Gzip strange behaviour | Eric Blade | 03/25/01 23:17 |
| RE: Caching in memory | Zeev Suraski | 03/25/01 17:30 |
| RE: gzhandler: don't beleive everything you read | Zeev Suraski | 03/25/01 17:23 |
| Tweaking code | Eric Blade | 03/24/01 11:15 |
| mod_gzip 1.3.19.1a | Tim Frank | 03/23/01 22:25 |
| RE: Gzip strange behaviour | Dave Gullo | 03/23/01 19:01 |
| RE: What load does GZIP put on the CPU? | Ingo | 03/23/01 11:20 |
| gzip? | Vladimir Rüntü | 03/23/01 03:14 |
| RE: Caching in memory | Piergiorgio Spagnolatti | 03/23/01 03:02 |
| RE: Gzip strange behaviour | Piergiorgio Spagnolatti | 03/23/01 02:43 |
| RE: gzhandler: don't beleive everything you read | Piergiorgio Spagnolatti | 03/23/01 02:41 |
| RE: That looks great | Piergiorgio Spagnolatti | 03/23/01 02:33 |
| RE: What load does GZIP put on the CPU? | Piergiorgio Spagnolatti | 03/23/01 02:30 |
| RE: PHP4 versus PHP3 | Piergiorgio Spagnolatti | 03/23/01 02:23 |
| Gzip strange behaviour | Michael Kimsal | 03/22/01 19:24 |
| Caching in memory | Onno Benschop | 03/22/01 18:52 |
| Well tackled the problem | Moritz Post | 03/22/01 14:00 |
| Somebody set up us the bomb! | Rich Alloway | 03/22/01 12:33 |
| PHP4 versus PHP3 | Michael Koehler | 03/22/01 12:09 |
| That looks great | Ronan | 03/22/01 11:09 |
| gzhandler: don't beleive everything you read | Tom Anderson | 03/22/01 10:28 |
| Addendum/Errata | Piergiorgio Spagnolatti | 03/22/01 06:14 |
| For more PHP speedup tips, visit this URL | John Lim | 03/22/01 02:05 |
| What load does GZIP put on the CPU? | stef | 03/21/01 23:54 |
|
If you are looking for help, please post on the appropriate forum here. Your questions will be answered much more quickly. | ||


