Also in PreferredClassProvider, there's an Arrays.equals comparison made on two 
arrays containing URL's.

It's no wonder the performance is bad, this will be causing multiple dns 
lookups.

I've altered PreferredClassProvider to use URI instead, URL is still used in 
one protected method and in PreferredClassLoader, but the annotation string is 
parsed as URI, then converted to URL, for Permissions and ClassLoading, however 
all comparisons are made using URI, to avoid DNS Lookup.

I haven't tested it yet, I'm waiting for a thunderstorm to pass, before firing 
up the old girl.

Will let you know the outcome, I haven't bothered about the global loader table 
lock at this stage, this will perform much faster now, so may not block as much.

If needed, I've got ReferenceCollection utilities, which allow the use of weak 
or soft references in ConcurrentMap, which will reduce remaining contention.

When it comes to ClassLoaders and classloading however you've got to be careful 
with concurrency.

Cheers,

Peter.

----- Original message -----
> Dennis,
>
> You utilise URIClassLoader which uses URI instead of URL, I've noticed
> that it's MPL, GPL or LGPL licensed so we can't distribute it with River.
>
> I've been looking into a subtle performance issue with
> PreferredClassProvider and PreferredClassLoader, an array of URL's are
> used as keys in a Map in PreferredClassProvider, I believe that this has
> a lot to do with the performance issues that Chris is experiencing with
> Reggie as posted on the user list.
>
> Any thoughts about making PreferredClassProvider and
> PreferredClassLoader use URI internally?
>
> Regards,
>
> Peter.

Reply via email to