Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46267 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50306 invoked from network); 3 Dec 2009 12:30:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Dec 2009 12:30:25 -0000 Authentication-Results: pb1.pair.com header.from=yoarvi@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=yoarvi@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.160.44 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: yoarvi@gmail.com X-Host-Fingerprint: 209.85.160.44 mail-pw0-f44.google.com Received: from [209.85.160.44] ([209.85.160.44:37998] helo=mail-pw0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 48/4B-02785-06FA71B4 for ; Thu, 03 Dec 2009 07:30:24 -0500 Received: by pwj15 with SMTP id 15so1116885pwj.23 for ; Thu, 03 Dec 2009 04:30:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=qioTdkZ1GuPC1+ZjxSq10GXfd7RYUbM/JM/UG9jrld8=; b=EmIDdlhmNprDmuieVDKA7WTdjOovEvWgQNL7GSiovRRQToIHtl+sBhVS/dGyIsqnB+ Z9+uJ8+VvxOnHHOJZgHapagUbcJGTwojmFphYQ8FzooqXWcaxOA2nvZfTSvpdg297Kv1 DVVsij7gC+bOoGxranvPFBSoLmxqglJdR4Ug8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=WrR6QUlgYrh2TXDqjIMGUpTkmV7QtbaoZi61OtndJim9MvwFfN+nb5/Ij89+0aMs6S 2uTc9BebddAPDQ8maGX0XaLYP3MPCvW+3JF3o1j9I/9ZLEYUK7aek+IMINHJksB73jzt RB5FkVSg0TLUV/9KzIveZp+1bbumtH5wjDUFY= MIME-Version: 1.0 Received: by 10.143.137.2 with SMTP id p2mr181990wfn.136.1259843422024; Thu, 03 Dec 2009 04:30:22 -0800 (PST) In-Reply-To: <1259669142.2291.9.camel@guybrush> References: <1259669142.2291.9.camel@guybrush> Date: Thu, 3 Dec 2009 18:00:22 +0530 Message-ID: To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [PATCH] - Improving multi-threaded performance by propagating TSRMLS_C From: yoarvi@gmail.com (Arvind Srinivasan) > >> (2) If the number of occurrences is large, then rename the function >> (prefix with _) and add a macro that passes TSRMLS_C >> e.g. >> -ZEND_API void zend_hash_destroy(HashTable *ht); >> +ZEND_API void _zend_hash_destroy(HashTable *ht TSRMLS_DC); >> +#define zend_hash_destroy(ht) _zend_hash_destroy((ht) TSRMLS_CC) > With the exception of the APIs mentioned below, I've undone this change and instead done a global search/replace of all the functions that needed to pass TSRMLS_C as a parameter. The only cases that I couldn't quite do this for are: convert_to_long convert_to_double convert_to_null convert_to_boolean convert_to_object convert_to_array in zend_operators.h The problem is that currently convert_to_string is already a macro that calls _convert_to_string passing 2 parameters whereas the above are functions that take only 1 parameter. conv_object_to_type expects all these APIs to have the same signature. >> (4) For single argument functions that have varags, pass TSRMLS_C as >> the first parameter >> e.g. >> -ZEND_API int zend_get_parameters_ex(int param_count, ...) /* {{{ */ >> +ZEND_API int zend_get_parameters_ex(TSRMLS_DC1 int param_count, ...) /*= {{{ */ >> >> where >> +#define TSRMLS_DC1 =A0 TSRMLS_D, >> +#define TSRMLS_CC1 =A0 TSRMLS_C, > > Are there more cases of this? - If zend_get_parameters is the only case > I'd keep the TSRMLS_FETCH in it. zend_get_parameters is deprecated and > shouldn't be used anymore. But adding a new macro makes it harder for > new people to get started with the code. I've backed out this change as well and instead used TSRMLS_FETCH() in those APIs that used TSRMLS_DC1/TSRMLS_CC1 (in my previous diff). I'll revisit those if they show up as performance hotspots. http://bitbucket.org/arvi/arviq/src/37f1d6b045b0/svn-TSRM-patch.txt contains the updated diff against trunk. I've compiled and run 'make test' on this after configuring it with the default module set and with/without --enable-maintainer-zts. Thanks, Arvi