cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rob Parker" <rob...@webcybernetics.com>
Subject Re: SAX Event cacheing & Generators
Date Wed, 03 May 2000 00:22:53 GMT
> I'm not exactly sure how you handle the virtual .vs. static "callback
> methods". Do you have any sample code snippets handy?

Fortunately the reflection api does alot of the work for me. When you use
the Method class
you call the invoke method with an object. Method objects 'know' whether
they were static
or not. Hence for static calls the invoke object parameter is ignored, for
member functions,
the invoke object is used for virtual dispatch.

hope this helps.

Rob
----- Original Message -----
From: Williams, Murray Todd <murray_williams@merck.com>
To: <cocoon-dev@xml.apache.org>
Cc: <robert@webcybernetics.com>
Sent: Tuesday, May 02, 2000 9:09 PM
Subject: RE: SAX Event cacheing & Generators


> Actually, I'm rather interested. I've been pondering for quite a while
> whether there might be a "raw form" of XML storage that would be good to
use
> to "serialize and deserialize" XML data for rapid storage and access in a
> database.  (Read: blob object storage.)
>
> I'm not exactly sure how you handle the virtual .vs. static "callback
> methods". Do you have any sample code snippets handy?
>
> Murray Todd Williams
>
> > ----------
> > From: Rob Parker[SMTP:robert@webcybernetics.com]
> > Reply To: cocoon-dev@xml.apache.org
> > Sent: Tuesday, May 02, 2000 6:48 AM
> > To: cocoon-dev@xml.apache.org
> > Subject: SAX Event cacheing & Generators
> >
> > I've been playing around with cacheing SAX Events. My motivation was to
> > implement something similar to the FileGenerator - without the overhead
> > of reading/parsing a file every request.
> >
> > Option 1 - cacheing the file contents as a String and parsing the String
> > at
> > each request. (Uses memory but removes the file read overhead.)
> >
> > Option 2 - parse the file once and build a list of 'pointers to callback
> > functions' using
> > the Method class, at each request, just run through the list and call
the
> > invoke method.
> > (Uses less memory than option 1 and may be faster)
> >
> > In my experience, If virtual callback methods are used, option 2 is
> > slightly slower than option 1. If static
> > callback methods are used, option 2 is much quicker than option 1.
> >
> > If this is of value to any Cocoon developers, then let me know.
> >
> > regards
> >
> > Rob
> >
> >
>


Mime
View raw message