[JAVASERVERFACES-1536] Performance problem in ApplicationImpl.createComponent(FacesContext context, Resource componentResource) Created: 04/Feb/10  Updated: 21/Mar/12  Resolved: 11/Feb/10

Status: Closed
Project: javaserverfaces
Component/s: facelets
Affects Version/s: 2.0.2
Fix Version/s: 2.0.3-b01

Type: Bug Priority: Major
Reporter: Frank Caputo Assignee: Ryan Lubke
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: Text File changebundle.txt    
Issuezilla Id: 1,536

 Description   

The following method has a performance problem (build 2.0.2-b10):

public UIComponent createComponent(FacesContext context, Resource
componentResource) throws FacesException

In line 976 the class loader is called, which is quite expensive. If you make
heavy use of composite components, the performance decreases dramatically under
heavy load because the class loader is synchronized.

You should remember that you already looked for a class and didn't find it. You
could simply map an inner class (e.g. ComponentNotFound) to the class name in
the component map.



 Comments   
Comment by Ryan Lubke [ 04/Feb/10 ]

Target 2.0.3.

Thanks for the report.

Comment by Ryan Lubke [ 08/Feb/10 ]

So we could probably doing something along the lines of the suggested fix when
ProjectStage is not Development. This would mean that in any other stages, a
compcomp added after it had been initially looked up still wouldn't be found.

Comment by Ryan Lubke [ 09/Feb/10 ]

Created an attachment (id=1097)
Proposed changes (version 1)

Comment by rogerk [ 09/Feb/10 ]

r=rogerk

Comment by Ryan Lubke [ 09/Feb/10 ]

Changes applied (r8311).

Comment by Frank Caputo [ 10/Feb/10 ]

Ryan,

how can one add a class in any other ProjectStage than Development?

Comment by Ryan Lubke [ 10/Feb/10 ]

Groovy scripts could be added.

Comment by Frank Caputo [ 11/Feb/10 ]

I thought groovy scripts are handled by createComponentFromScriptResource.

Comment by Manfred Riem [ 21/Mar/12 ]

Closing out resolved issue

Generated at Sat Mar 07 02:48:55 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.