Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46250 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 89714 invoked from network); 30 Nov 2009 14:26:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Nov 2009 14:26:57 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.222.176 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.222.176 mail-pz0-f176.google.com Received: from [209.85.222.176] ([209.85.222.176:64328] helo=mail-pz0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 13/28-43487-E26D31B4 for ; Mon, 30 Nov 2009 09:26:55 -0500 Received: by pzk6 with SMTP id 6so2462911pzk.29 for ; Mon, 30 Nov 2009 06:26:52 -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:cc:content-type; bh=1aV1g4M5pUnzLHR4nv1Ox3OnaRPXkuoqRMqV4O2N0l8=; b=PFW5UMp9c9WzUymsoIqnFDpZPCCYkPvO2eiMBsAO/BJNU4ZX0biKaXJjCqJoxFxOLT 3PROkGK/QzqvHrEmzyaNu6J3Kbd+P7QNxYykcQ9Ys8Sgt8Q5hML2vrU0g/L0zMhr/e0b MQlM86vB0EZ9YIsKcluBXV2B+XGO8SisJCKI8= 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 :cc:content-type; b=glf6ws2mS1BhBiANGSmrwCk7LXcrVqv4BpRunjZTIXrsqqFp4Y5sEf+J8bRsKy9GdQ qPj48kJ5wuRLQEpy7XbepnYeC06KhzdAzjtkFX5ms5R7PXzbtmwF+q2ip0Ew49rF6ZnO SA1g4tB9Zoz5AptO2EfrCQs97z12TGaH+fp9o= MIME-Version: 1.0 Received: by 10.143.20.10 with SMTP id x10mr445176wfi.224.1259591211798; Mon, 30 Nov 2009 06:26:51 -0800 (PST) In-Reply-To: References: Date: Mon, 30 Nov 2009 15:26:51 +0100 Message-ID: To: Arvind Srinivasan Cc: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] [PATCH] - Improving multi-threaded performance by propagating TSRMLS_C From: pierre.php@gmail.com (Pierre Joye) hi Arvind! Yes, to get rid of TSRMLS_FETCH is a very good thing as it is horribly slow (as you noticed). However it can't be done in 5.3 as it will break the ABI. About the patch itself, as it will break ABI anyway, I would go wit the solution 1) only. That's cleaner and consistent with what we usually do. thanks for your work :) On Mon, Nov 30, 2009 at 2:32 PM, Arvind Srinivasan wrote: > When running a benchmarking workload on PHP that was configured with > multi-threading support (--enable-maintainer-zts) I noticed that > pthread_get_specific is invoked many times during the processing of a > request. PHP code invokes TSRMLS_FETCH() (which ends up invoking > ts_resource_ex) in a number of places. > (1) If the number of occurrences of the API to be modified are > relatively small, then make the change directly. > e.g. > -int fcgi_accept_request(fcgi_request *req); > -int fcgi_finish_request(fcgi_request *req, int force_close); > +int fcgi_accept_request(fcgi_request *req TSRMLS_DC); > +int fcgi_finish_request(fcgi_request *req, int force_close TSRMLS_DC); Cheers, -- Pierre http://blog.thepimp.net | http://www.libgd.org