Re: Feedback requested on using #defines to improve the performance of the TSRMG macro
| From: | Stanislav Malyshev | Date: | Thu, 05 Nov 2009 23:33:32 +0000 |
| Subject: | Re: Feedback requested on using #defines to improve the performance of the TSRMG macro | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-45962@lists.php.net to get a copy of this message | ||
Hi!
When compiled for multi-threaded (#ifdef ZTS ) operation, the various subsystems in PHP use dynamically allocated (ts_allocate_id) identifiers to index into the thread-local storage for each subsystem. These dynamically allocated ids are used by macros such as CG, EG, PG, AG.I think it makes sense. One note on the patch - you don't have to replace XXX_core_globals_id with XXX_GLOBALS_ID everywhere, especially in init code, etc. which is not performance-sensitive, as you already have these values assigned. Also, ts_allocate_reserved_id doesn't really allocate anything anymore, as far as I can see. 50 reserved IDs can be an overkill though... I'd say only core IDs get revervations, all extensions should be dynamic. Also, ts_allocate_reserved_id seems to allow zero size as argument, but then allows to override such ID with another call of ts_allocate_reserved_id, while it does not allow this for non-zero sizes. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com