Performance tuning PHP5

php.internals

Sterling Hughes

23 years ago
Hey, I've been benchmarking the PHP5 and PHP4. Found a neat little way to improve the performance like crazy. Go into zend_mm.h and change: #define ZEND_MM To: #undef ZEND_MM And touch zend_alloc.c, recompile, and then rebenchmark. My tests show a 15-20% performance improvement *across the board* between before and after. This probably increases if you're using a webserver like apache, where the memory manager really screws things up. -Sterling
-- "C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg." - Bjarne Stroustrup

Daniel T. Gorski

23 years ago
On 20 May 20:38, Sterling Hughes wrote: Hi,
> #define ZEND_MM > To: > #undef ZEND_MM
> And touch zend_alloc.c, recompile, and then rebenchmark. My tests show > a 15-20% performance improvement *across the board* between before and > after. This probably increases if you're using a webserver like apache, > where the memory manager really screws things up.
I've here a midsize PHP5 application (about 50K LOC) with a lot of abstraction layers running as CGI ... disabling MM accelerated the whole thing by about 25%, or even more. Are there any problems expected without the MM? regards dtg

Andi Gutmans

23 years ago
At 05:16 AM 5/21/2003 +0200, Daniel T. Gorski wrote:
>On 20 May 20:38, Sterling Hughes wrote: > >Hi, > > > #define ZEND_MM > > To: > > #undef ZEND_MM > > > And touch zend_alloc.c, recompile, and then rebenchmark. My tests show > > a 15-20% performance improvement *across the board* between before and > > after. This probably increases if you're using a webserver like apache, > > where the memory manager really screws things up. > >I've here a midsize PHP5 application (about 50K LOC) with a lot of >abstraction layers running as CGI ... disabling MM accelerated the whole >thing by about 25%, or even more. > >Are there any problems expected without the MM?
Nope. Andi