Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:45962 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85356 invoked from network); 5 Nov 2009 23:34:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Nov 2009 23:34:08 -0000 Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=stas@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.185 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 212.25.124.185 il-mr1.zend.com Received: from [212.25.124.185] ([212.25.124.185:37474] helo=il-mr1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FC/B6-48879-EE063FA4 for ; Thu, 05 Nov 2009 18:34:08 -0500 Received: from us-gw1.zend.com (unknown [192.168.16.5]) by il-mr1.zend.com (Postfix) with ESMTP id 4E210504CA; Fri, 6 Nov 2009 01:21:48 +0200 (IST) Received: from [192.168.27.1] ([192.168.27.1]) by us-gw1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 5 Nov 2009 15:33:34 -0800 Message-ID: <4AF360CC.7010508@zend.com> Date: Thu, 05 Nov 2009 15:33:32 -0800 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Arvind Srinivasan CC: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 05 Nov 2009 23:33:34.0871 (UTC) FILETIME=[647C8270:01CA5E70] Subject: Re: [PHP-DEV] Feedback requested on using #defines to improve the performance of the TSRMG macro From: stas@zend.com (Stanislav Malyshev) 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