Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:251 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9377 invoked from network); 25 Mar 2003 09:38:55 -0000 Received: from unknown (HELO wmeler.t1.gda.wp-sa.pl) (212.77.105.136) by pb1.pair.com with SMTP; 25 Mar 2003 09:38:55 -0000 Received: (from wmeler@localhost) by wmeler.t1.gda.wp-sa.pl (8.11.6/8.11.6) id h2P9bxj19520; Tue, 25 Mar 2003 10:37:59 +0100 X-Authentication-Warning: wmeler.t1.gda.wp-sa.pl: wmeler set sender to wmeler@wp-sa.pl using -f Date: Tue, 25 Mar 2003 10:37:59 +0100 To: Zeev Suraski Cc: internals@lists.php.net Message-ID: <20030325103759.I31290@wp-sa.pl> Reply-To: wmeler@wp-sa.pl References: <3b6af3b7d2.3b7d23b6af@wp-sa.pl> <5.1.0.14.2.20030324214937.04581cf0@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <5.1.0.14.2.20030324214937.04581cf0@localhost>; from zeev@zend.com on Mon, Mar 24, 2003 at 09:59:36PM -0800 Subject: Re: [PHP-DEV] ZTS performance From: wmeler@wp-sa.pl (Wojtek Meler) On Mon, Mar 24, 2003 at 09:59:36PM -0800, Zeev Suraski wrote: > If __thread is any similar to Tls under Windows (which would be my guess), > then we can't use it directly. We're already using pthread_setspecific so > we're extremely quick with fetches as it is. As I said, I also doubt very > much that our performance penalty is solely due to fetches, but mostly > based on other issues, which __thread will not alter in any way. You're > more than encouraged to try and implement a __thread based solution in > place of the pthread_setspecific solution and see if it makes any > difference. If it does, we can investigate further in that direction and > see if it's usable. I suppose that __thread is similar to __declspec( thread ). I really don't know what is faster - using __thread / __declspec(thread) struct {..} thread_globals; and accesing it in code by thread_globals.variable which probably relay on CPU's MMU (depends on compiler and libc) is probably faster than (((type) (*((void ***) tsrm_ls))[TSRM_UNSHUFFLE_RSRC_ID(id)])->element) which cannot be well optimized because id is global variable and could change between function calls. I won't argue - you have more experience. I'll try to implement TSRM macros, but I don't have time now. I'll do it in July (if it won't be implemented yet). Regards, Wojtek