2016-01-23 15:17 GMT+03:00 Rainer Jung <rainer.j...@kippdata.de>:
> I observed a bottleneck in WebappClassLoaderBase.filter() during a stress
> test. The reason is, that the method is synchronized. It looks to me, that
> the reason for the synchronization is only the access to the non-thread safe
> Matchers packageTriggersPermit and packageTriggersDeny. Since they are not
> used anywhere else, IMHO one can get away with using a separate Lock object
> for access to the two. E.g.
>

1. Instead of a lock it is possible to create a new Matcher object on
each invocation.

2. There is no need for those Matcher / new Lock object to be
"protected". An interested party can overwrite the whole filter()
method.

3. Filtering resources and classes with the same regexp looks wrong.

It is safe to use that regexp on class names (those do not have '/'
character in them), but it is wrong to use it on resources ('.' is a
valid character in a file name, not a package separator).

4. Generally (if I remember correctly) this filter
a) saves people that do a stupid thing of trying to bundle API classes
or Tomcat classes in their war (e.g. due to misconfiguration of Maven
dependencies)

b) allows a performance improvement, as the search for those classes
in web application classloader can be skipped



Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to