On Sun, 15 Oct 2000, Jon Stevens wrote:

> on 10/15/2000 4:23 AM, "Daniel L. Rall" <[EMAIL PROTECTED]> wrote:
> 
> > I'm curious why we need a pool of parsers.  This is something that I
> > would be interested in implementing, if we really need it. :)
> > 
> >> From Parser.java:
> > 
> > /** 
> > * The Runtime parser. This has to be changed to
> > * a pool of parsers!
> > */
> > private static Parser parser;
> 
> The reason is MT issues. The Parser is syncronized and thus, only one
> instance of parsing can be running at any one time. Having a pool would
> allow us to have N number of parsers going at the same time. Note, I believe
> this is just the initial parsing of the file into an AST, not the actual
> execution of the AST. So, it really isn't a huge performance hit right now,
> but will become one later as more and more people put load on Velocity.

Yes, the parsing won't happen very often. Jon is correct, the
parsing turns the template into an AST and the AST is repeatedly
traversed. It wouldn't have to be a huge pool, but it would be
nice.

And I'm sure there are other places in the code where 
pools might be useful.

jvz.

Reply via email to