myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leonardo Uribe <lu4...@gmail.com>
Subject Re: [core] performance: synchronized access for java.beans.PropertyDescriptor.getReadMethod()
Date Thu, 04 Aug 2011 20:32:03 GMT
Hi

2011/8/4 Martin Koci <martin.kocicak.koci@gmail.com>:
> Hi,
>
> I'm testing a view where hundreds of concurrent users are expected. I
> noticed that  java.beans.PropertyDescriptor.getReadMethod() is
> sychronized method and many times are other threads blocked with same
> lock (java.beans.PropertyDescriptor instance).  Myfaces use it in
> _ComponentAttributesMap:
>
>
> <BLOCKED> java.beans.PropertyDescriptor.getReadMethod <-
> javax.faces.component._ComponentAttributesMap.getComponentProperty(PropertyDescriptor)<-
> javax.faces.component._ComponentAttributesMap.get(Object)
>
> All threads share the same java.beans.PropertyDescriptor instance.
>
> Very similar problem was reported by a user [1]. For this case, it seems
> that weblogic "thinks" that thread is [STUCK] beacuse it was simply
> blocked for too long.
>
> Any ideas hot to improve it? Are Method instances cacheable? For
> example, Spring [2] cache them under certain circumstances. I don't know
> this low level of reflection well ...
>

In theory method instances are cacheable, because once initialized, it
never changes. Maybe we can create a fine wrapper over the real
PropertyDescriptor that cache Method instances or something like that.

regards,

Leonardo Uribe
>
> Regards,
>
> Kočičák
>
> [1] http://www.mail-archive.com/users@myfaces.apache.org/msg57504.html
> [2]
> http://javasourcecode.org/html/open-source/spring/spring-3.0.5/org/springframework/beans/CachedIntrospectionResults.java.html
>
>

Mime
View raw message