Re: Feedback requested on using #defines to improve the performance of the TSRMG macro
| From: | Christopher Jones | Date: | Thu, 05 Nov 2009 20:12:03 +0000 |
| Subject: | Re: Feedback requested on using #defines to improve the performance of the TSRMG macro | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-45958@lists.php.net to get a copy of this message | ||
Arvind Srinivasan wrote:
I'd vote that the reserved slots be assigned from day 1 for one of (i) always-enabled core extensions or (ii) for core + common extensions or {iii} the whole set of PHP-bundled extensions + common extensions from PECL (i.e. APC?). The choice of (i), (ii) or (iii) would depend on your tests. All other extensions should use a run-time allocated non-reserved slot. Extensions that become popular can add an xxx_GLOBALS_ID entry to zend_globals_macros.h. Chris -- Blog: http://blogs.oracle.com/opal Twitter: http://twitter.com/ghrdDoes the GLOBALS_ID_BASE idea work? In "ts_allocate_reserved_id(GLOBALS_ID_BASE+1...)" each extension would anyway need to reserve an increment to avoid clashes. Also, why isI didn't really try using this. When I added it, I thought it might be useful for modules that live outside the PHP source tree. They could then define their constants using #define FOO_ID (GLOBALS_ID_BASE + 3) rather than hardcoding 33. As you point out, they would still need to reserve an increment.GLOBALS_ID_BASE 30 when the largest reserved value is 18? Maybe I'm missing something.I reserved IDs for the subsystems I thought were core. I was sure there'd be others that I'd missed and so I left space for more.Would there be significant memory space or locality issues if one ID per extension in the PHP source bundle was reserved upfront, even if those extensions were never enabled?I'll run some tests and see what impact this has.