Re: ZTS performance

From: Date: Tue, 25 Mar 2003 09:59:41 +0000
Subject: Re: ZTS performance
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-252@lists.php.net to get a copy of this message
At 01:37 25/03/2003, Wojtek Meler wrote:
__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)
If you compare these, no doubt the former will be slightly faster. But you won't be comparing these, as it will most probably not be practical to have different TLSs for shared objects, the number of TLSs is very limited, and at least under Windows, there are serious limitations with their use in the context of DLLs. This is what made us forget about it under Windows. Instead, the only thing you will be able to effectively use it for is one single TLS, as we already do today with TSRM. So essentially, you'd have to do something very similar to what we're doing today. The one field where this may save is the need to pass the context all over PHP, but it will most probably make no difference as far as fetches are concerned. Another note to remember is that we heavily rely on just-in-time construction of such globals. It won't necessarily be easy to implement such a feature if we let the compiler do it. signing off for the night, Zeev

« previous php.internals (#252) next »