Hi,

another performance related problem in TagAttributeImpl: ValueExpression
instances.

Consider a facelets view with 3000 attributes. Then during buildView
method TagAttributeImpl.getValueExpression allocates:

1) one instance of ValueExpression via
ExpressionFactory.createValueExpression

2) one instance of ValueExpression as TagValueExpression

3) if TagAttribute is inside composite component then allocates another
instance of LocationValueExpression.


In this test case buildView creates at least 6 000 instances of
ValueExpression. This is not problem because instances are cheap and
allocation doesn't affect CPU consumption. Problem appears if more
threads do the same: for 100 threads/requests it is 600 000 instances;
consider it for 1000 concurrent requests. All those instances are very
short-lived and practically never leave HotSpot's Young Generation space
and triggers GC excessively; GC management it the main problem : after
one hour of running stress test is TagAttributeImpl.getValueExpression
#1  in "hot spot by object count" with millions of allocations.

At first sight allocations 2) and 3) serves only as a kind of
TagAttribute <-> ValueExpression mapping. Specially the second one holds
only one String which serves later for a nicer exception report.

It seems that some better kind of TagAttribute <-> ValueExpression <->
(String, Localtion) relation reprezentation without using wrapper
pattern can solve this problem. Any ideas how to do it?


Regards,


Kočičák







Reply via email to