At 10:41 AM 6/8/2002 +0300, Andi Gutmans wrote:
>At 09:12 PM 6/7/2002 -0700, Brian Pane wrote:
>>In case it's helpful to the PHP developers, here are
>>some more performance problems that I found by running
>>a quick system call profile of PHP-4.2.1 within
>>Apache-2.0.37-dev:
>>
>>* php_request_shutdown() calls shutdown_memory_manager(), which
>>  does a large number of calls to free() per request.  If there's
>>  any way to get the PHP allocator to use an APR pool, that
>>  should help speed things up a lot.  (The mallocs and frees are
>>  going to be especially problematic within multithreaded MPMs.)
>
>We're already doing this for Win32. Check out 
>ZEND_DO_MALLOC/ZEND_DO_FREE/ZEND_DO_REALLOC in zend_alloc.c. Note that in 
>Win32 we only skip the free's if we're in release mode. If we're in debug 
>mode we use a per-thread pool but we do the frees because it's our memory 
>leak detector.

I just checked and it seems like Apache APR memory pools use mutex locking.
It'd be better to use functions like the Win32 ones which don't use mutex 
locking (as we made sure that only one thread allocates from its pool). 
This could be achieved by compiling apr_pools.c without APR_HAS_THREADS but 
I bet the default Apache 2 build has this enabled.
Any ideas?
Andi


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to