cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Williams, Murray Todd" <>
Subject RE: SAX Event cacheing & Generators
Date Thu, 04 May 2000 14:11:07 GMT
I must confess I'm just now starting to play directly with the DOM and SAX
APIs, so I'm not perfectly clear on how the "instance callbacks" and "static
callbacks" system is implemented.  Does a different customized class have to
be created for each document DTD that you wish to serialize, or is it
possible to write a generic utility class that would serialize and
deserialize from SAX to a binary stream?

A difference of 110ms verses 250ms is at least an order of two, although
that order of two could end up being Orders of Magnitude smaller than a host
of other speed issues that a high-load web site might encounter.

I'm still imagining a site with libraries of content stored in databases
could take advantage of such a system.


> ----------
> From: 	Rob Parker[]
> Reply To:
> Sent: 	Wednesday, May 03, 2000 8:23 PM
> To:
> Subject: 	Re: SAX Event cacheing & Generators
> ----- Original Message -----
> From: Williams, Murray Todd <>
> [snip...]
> >
> > I'm still curious about Rob Parker's claim about static callback methods
> > giving a speed gain in his testing. Nevertheless, this is an issue best
> > re-examined later.
> I must admit that I was suprised at how fast the parsers are - for my
> limited
> tests I had the following environment...
> P-III 500 / NT4.0 JDK1.2.2 Hotspot 2.0 RC2
> I was parsing an 800k file - I effectively parsed the file 1000 times in
> a loop, recorded the total time in the loop and divided by 1000. The
> two approaches I took were to store the file as a String and parse the
> string,
> and to store a list of  'callbacks'. For the callbacks I compared both
> instance methods,
> and class methods (statics). My results were...
> parse String            250ms
> instance callbacks    310ms
> static callbacks        110ms
> What this indicates to me is that the parser is fast, the invoke method of
> the Method class
> is slow for instance methods. This is by no means a rigorous test - but it
> did satisfy my
> curiosity :-)

View raw message