Re: [xml] Deep-copy of xsltStylesheetPtr?

On Sat, 18 Sep 2004, Daniel Veillard wrote:
  I think you should try to keep the compiled stylesheet in the shared
memory and if possible adress it directly from the child processes if
possible, that would be optimal I think. What would prevent sharing that
way ?

The biggest problem would be doing this transparently.  Mixing the memory
management like this leads to madness.  Technically there is nothing
preventing it, it just gets really complex to keep track of which objects
PHP is allowed to touch in terms of memory management and which ones it
isn't.  We try to keep things very modular with as few interdepencies as
possible.  There is actually have an alternative xslt extension that
allocates everything out of shared memory like you suggested and that
works, but it doesn't work so well for this transparent layer I am working
on now.  This layer isn't just for XML and XSLT, it is for anything PHP
data structure.

I think I will just make use of the fact that I can cache an xmlDoc easily
and move it back and forth.  That still helps a bit as I can cache the
stylesheet xmlDoc in shared memory, xmlCopyDoc() it out into PHP
per-request memory and then xsltParseStylesheetDoc() it there.  That
leaves me with a normal stylesheet object and I don't have to worry about
something down the line trying to munge it in the wrong allocation


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]