#50333 [NEW]: [PATCH] - Improving multi-threaded scalability by using emalloc/efree/estrdup
| From: | yoarvi at gmail dot com | Date: | Mon, 30 Nov 2009 12:45:16 +0000 |
| Subject: | #50333 [NEW]: [PATCH] - Improving multi-threaded scalability by using emalloc/efree/estrdup | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-145210@lists.php.net to get a copy of this message | ||
From: yoarvi at gmail dot com
Operating system: Solaris 5.10 (SPARC)
PHP version: 6SVN-2009-11-30 (SVN)
PHP Bug Type: Performance problem
Bug description: [PATCH] - Improving multi-threaded scalability by using emalloc/efree/estrdup
Description:
------------
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
[http://marc.info/?l=php-internals&m=125846494007872&w=2]
Expected result:
----------------
Improved scalability on multi-threaded/multi-core systems.
--
Edit bug report at http://bugs.php.net/?id=50333&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=50333&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=50333&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=50333&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=50333&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=50333&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=50333&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=50333&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=50333&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=50333&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=50333&r=support
Expected behavior: http://bugs.php.net/fix.php?id=50333&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=50333&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=50333&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=50333&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50333&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=50333&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=50333&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=50333&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=50333&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=50333&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=50333&r=mysqlcfg