[PATCH] - Improving multi-threaded scalability by using emalloc/efree/estrdup instead of malloc/free/strdup in virtual_cwd APIs

From: Date: Tue, 17 Nov 2009 13:34:54 +0000
Subject: [PATCH] - Improving multi-threaded scalability by using emalloc/efree/estrdup instead of malloc/free/strdup in virtual_cwd APIs
Groups: php.internals 
Request: Send a blank email to internals+get-46070@lists.php.net to get a copy of this message
Using malloc/free in a multi-threaded process limits its scalability because of the process-wide lock inside malloc/free. The scalability of the PHP engine in a multi-threaded process can be improved by reducing the use of malloc/free/strdup and instead using emalloc/efree/estrdup wherever possible (at least in the main request processing code paths). The code paths in TSRM/tsrm_virtual_cwd.c are invoked quite frequently and they use malloc/free/strdup. I'd like to submit the following patches (based on the PHP6 source tree) for review that incorporate the use of emalloc/efree/estrdup in the virtual_cwd code paths. In order to use emalloc/efree I had to relocate tsrm_virtual_cwd.c from the TSRM directory to the Zend directory. I've split the change into 3 patches in order to make the changes easy to see Avoid name clash between global and local variable (http://bugs.php.net/bug.php?id=50101) http://bitbucket.org/arvi/arviq/src/tip/arvi-08-namespace Rename TSRM/tsrm_virtual_cwd.[ch] to Zend/zend_virtual_cwd.[ch] http://bitbucket.org/arvi/arviq/src/tip/arvi-08-virtual_cwd Replace malloc/free/strdup with emalloc/efree/estrdup http://bitbucket.org/arvi/arviq/src/tip/arvi-08-virtual_cwd-emalloc Thanks, Arvi

« previous php.internals (#46070) next »