Leo Simons wrote:
On 28-07-2005 15:01, "Sylvain Wallez" <[EMAIL PROTECTED]> wrote:
I'd like to propose a small change to the Source contract so that
SourceResolver.release() is far more efficient.
Currently, releasing a Source requires to lookup the SourceFactory in
the selector and calling release(Source) on that class. Now looking
around, I found only _one_ implementation of SourceFactory that
effectively does something useful in it's release() method, which is
Cocoon's SitemapSourceFactory.
All other implementations do _nothing_, leading to a lot of useless
lookups. Considering how much source-intensive Cocoon is, this may be
significant.
To avoid this, I'd like to propose a small change to the
SourceResolver.release() contract: if the Source implements Disposable,
then it's dispose() method is called, and otherwise the factory is
looked up as of today.
We then have to add empty dispose() methods to all source
implementations to benefit from the performance improvement.
How does that sound?
Hmmmmmm...like a backward-incompatible change for both source and binaries.
Uh? I don't see why. It's an optional interface for Source
implementations. It changes none of the current interfaces, and existing
implementations shoud run unmodified.
I'd suggest getting some profile data showing this is significant rather
than working on a "hunch". And even then, I dislike having to break
interfaces for performance reasons. It seems to make sense to make lookup
less resource intensive instead :-)
Well, it's difficult to do something better than a few hashmap puts and
gets, and possibly crawl up the service manager hierarchy. All this to
end up calling an empty method...
Sylvain
--
Sylvain Wallez Anyware Technologies
http://people.apache.org/~sylvain http://www.anyware-tech.com
Apache Software Foundation Member Research & Technology Director
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]