myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leonardo Uribe (Created) (JIRA)" <>
Subject [jira] [Created] (MYFACES-3486) [perf] cache Factories to prevent unnecessary FactoryFinder.getFactory() calls
Date Sat, 03 Mar 2012 16:35:57 GMT
[perf] cache Factories to prevent unnecessary FactoryFinder.getFactory() calls

                 Key: MYFACES-3486
             Project: MyFaces Core
          Issue Type: Improvement
          Components: JSR-314
            Reporter: Leonardo Uribe
            Assignee: Leonardo Uribe

FactoryFinder.getFactory() contains some synchronized blocks. The code is fast enough, but
it could be good to prevent those calls if is not really necessary. 

Checking this stuff I had an idea about how to prevent those calls. The idea is call FactoryFinder.getFactory()
in the factory itself, and then pass the factory as a param for the object that uses it (FacesContext
or PartialViewContext or whatever). Also, we can replace VisitContext.createVisitContext with
calling the factory and then getVisitContext() directly (note createVisitContext is an static
method thought for users). Additionally, add some volatile variables in some places to prevent
multiple initializations is a good idea too.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message