cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler" <>
Subject RE: Defining Source Interfaces
Date Wed, 08 Jan 2003 09:05:28 GMT
Sylvain Wallez wrote:
> The performance problem is that among all implementations of Source that 
> I know of (URLSource, FileSource, SlideSource, BlobSource, XMLDBSource, 
> SitemapSource and CVSSource), only one actually needs to be disposed 
> (SitemapSource).
> So having a isSelectable()-select()-release() cycle to call a 
> factory.release() that does nothing most of the time seems CPU 
> waste to me.
> Now I agree that theoretically releasing is the factory's job. So, in 
> order to lower my performance fears, what about removing the 
> isSelectable() call in SourceResolverImpl.release() ? It would remove an 
> unnecessary search in the ServiceSelector HashMaps, considering also 
> that the select() that follows this isSelectable() is surrounded by a 
> try/catch.
Wow, entering twilight zone...believe it or not, I just thought of this
yesterday evening when I tried to think about some general performance
Actually, I wasn't sure about it, because if we are honest, it's a hack.
And throwing/catching exceptions is also a little bit time consuming.
But as a (better?) solution I would like to make a factory for the
URLSource as well - so all sources are handled by a factory and the
select() call will always return a factory - and this will avoid
the isSelectable() call.
What do you think about this?

Ah, btw you're right that the Source object should return a Collection
instead of an Iterator for the children - I will fix that, too, asap.


Carsten Ziegeler 
Open Source Group, S&N AG

To unsubscribe, e-mail:
For additional commands, email:

View raw message