On Saturday 02 February 2002 13:03, Robin Berjon wrote:
> On Saturday 02 February 2002 18:44, Tod Harter wrote:
> > On Saturday 02 February 2002 09:27, Matt Sergeant wrote:
> > > On Sat, 2 Feb 2002, Marc-Olivier Bernard wrote:
> > > > Hi,
> > > >
> > > > Is it, in both cases, in memory caching or object persistence ?
> > >
> > > In memory. Object persistence wouldn't work.
> >
> > I'm not sure "object persistence wouldn't work" but the real question is
> > would the overhead of serialization/deserialization be any less than the
> > overhead of parsing the stylesheet each time? I doubt it would be much of
> > a gain, unless the stylesheet itself is the result of significant
> > processing, in which case its probably better done in some pre-processing
> > step anyhow.
>
> No, object persistence "could" work but the gains are very incertain. The
> only efficient way of serialising an XML document (which a stylesheet is)
> is XML. All attempts thus far to find a better serialisation format have
> hit a wall which is the fact that XML parsers are very optimized beasts
> that are hard to beat at what they do. Also, the serialisation of a
> (possibly optimized after parsing) stylesheet object as returned for
> instance by XML::LibXSLT is not a trivial task as it isn't a pure Perl
> object.
>
> One place where object persistence "might" be of interest is having those
> cached stylesheets in shared memory instead of in process memory. I am not
> sure that this would be a serious gain, unless of course one has many
> and/or large stylesheets. I'm willing to place this in the TODO if there's
> serious interest (ie someone that sees this as a real world problem, not
> just as a cool optimisation that'll save 200 bytes of memory).

Hmmm, for that though I think it would be better to patch libxml so it just 
stored its DOM trees in shared pages and be done with it ;o). I doubt it 
would be a very tough patch to write, just a custom memory allocator and a 
few tweaks here and there. If its good code it should be easy.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to