[jdom-interest] lookup for the parser

Jason Hunter jhunter at collab.net
Fri Mar 23 13:30:54 PST 2001

I just timed how long it takes to execute the build() method up until to
the parse step.  The first time though takes a bit of time due to class
loading.  The second time through takes "0" milliseconds.  It's faster
than the resolution on the system clock.  Seems it's not expensive
enough to worry about.


Kesav Kumar wrote:
> Right now in SAXBuilder all the logic for lookup for the parser and
> instantiating the correct parser is in build method.  Usually people create
> SAXBuilder instance once and try to parse as many documents as they want.  I
> feel we can skip this logic of looking up for parse and instantiating parser
> can be skipped if we move the logic to constructor.  Right now when ever we
> use build method all the logic gets executed which involves method
> invcoations through reflection which is an expensive.  We can reduce all
> these costs if we move the logic from build method to constructor of the
> SAXBuilder.  Making the parser(XMLReader object) static would reduce the
> parser lookup every time.
> Kesav Kumar
> Software Engineer
> Voquette, Inc.
> 650 356 3740
> mailto:kesavk at voquette.com
> http://www.voquette.com
> Voquette...Delivering Sound Information
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com

More information about the jdom-interest mailing list