ZTS is *always* going to be slower than non ZTS. There's no need for
rewriting TSRM, it's roughly as fast as it can be. We may still be able to
squeeze a bit more performance by reducing the number of fetches, but most
fetches have already been eliminated, so I don't anticipate too much gains
here. As Andi mentioned, about a year and a half ago we worked furiously
to reduce the number of fetches. Most of those remaining are either too
difficult to get rid of, or too ugly to get rid of. If people come up with
patches that reduce the number of fetches, I'll be more than happy to go
over them and commit them if they don't mess up the code too much...
Note that only some of the slowdown is coming from fetches. Much of it is
incurred by having to just do more - send extra arguments to virtually all
function calls (when the context is passed, rather than fetched), having to
calculate access to global elements in runtime instead of compile time,
(CG(foo) resolves to a 'static' reference in non-ZTS, but a pointer based
reference in ZTS), perform locking (very much reduced in modern versions of
TSRM thanks to the Zeus guys) and use thread-safe system calls. Thread
safety costs!
Zeev
At 04:58 24/03/2003, Wojtek Meler wrote: