Re: Feedback requested on using #defines to improve the performance of the TSRMG macro
| From: | Arvind Srinivasan | Date: | Fri, 06 Nov 2009 10:35:12 +0000 |
| Subject: | Re: Feedback requested on using #defines to improve the performance of the TSRMG macro | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-45968@lists.php.net to get a copy of this message | ||
Hi,
I've updated my patch based on your feedback.
http://bitbucket.org/arvi/arviq/src/tip/arvi-16-ts_allocate_reserved_id
incorporates the following changes:
* xxx_globals_id replaced with XXX_GLOBALS_ID only when used in macros
and not in init code etc
* ts_allocate_reserved_id renamed to ts_reserve_id as Stas pointed out
that it doesn't actually allocate anything
* MAX_RESERVED_IDS set to 20. I have assigned upto 18 so far, but I
didn't do the win32 ones as I don't have a dev environment on Windows
* ts_reserve_id doesn't allow 0 as a value for size or for rsrc_id
The memory impact of reserving ids
= sizeof(tsrm_resource_type) * MAX_RESERVED_IDS * NUM_THREADS
= 16 * MAX_RESERVED_IDS * NUM_THREADS
Please let me know if the diffs above look okay and if so I'll create
a bug to track the patch. I ran 'make test' to verify that the patch
didn't cause regressions.
I haven't changed cwd_globals_id to use ts_reserve_id/CWD_GLOBALS_ID,
since tsrm_virtual_cwd is in the TSRM directory and all the
XXX_GLOBALS_ID are defined in the Zend directory. I will shortly be
proposing to move tsrm_virtual_cwd to the Zend directory and so I left
CWD_GLOBALS_ID as is in the list of reserved ids.
Thanks,
Arvi