Ah, thanks -- actual data is always useful. That seems like the right approach - define a SimplePool style interface and a factory interface. Then let the user configure a SimplePoolFactory plugin.
WILL On 3/3/06, Serge Knystautas <[EMAIL PROTECTED]> wrote: > > On 3/3/06, Will Glass-Husain <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I'd argue that SimplePool is a utility class and not part of the public > API > > (so it's ok to change this). Have to draw the line somewhere - > otherwise we > > can never change anything. Anyone object? > > > > I'm not really following the problem with factories -- I'll wait to see > > until I see some code to comment on this. > > > > Llewellyn Falco has a Eclipse code formatting file. I had a copy but my > > computer is in the shop. Llewellyn are you out there? > > > > Best, WILL > > I reran my benchmarks to conclude whether parser pooling is necessary. > I changed to 0 parsers in the pool (so a new one is created each > template compilation) for these numbers... > > 4k template file > 3.4Ghz HP laptop > Win JDK 1.5 > run 1000 times > > 5,250ms to compile template by reusing parser > 6,953ms to compile template creating a parser each time > > So given 1,000 iterations, about 1.7ms to create a parser. > > WRT my comments about refactoring, the SimplePool is IMO not a pool > but an array. Right now, RuntimeInstance creates simplepool, iterates > through the # of spots in the pool, constructs a parser and assigns it > to that spot. Then whenever RuntimeInstance needs a parser, it checks > if one available in simplepool, and if not, it constructs a new one. > > I think of a pool as providing object instances and the user does not > know whether it is a reused or new instance. To do this, a pool needs > a factory to create a new one when necessary. Hope that clarifies. > > -- > Serge Knystautas > Lokitech >> software . strategy . design >> http://www.lokitech.com > p. 301.656.5501 > e. [EMAIL PROTECTED] > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- _______________________________________ Forio Business Simulations Will Glass-Husain phone (415) 440-7500 x89 mobile (415) 235-4293 [EMAIL PROTECTED] www.forio.com
