myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leonardo Uribe (JIRA)" <>
Subject [jira] [Resolved] (MYFACES-3550) [perf] minimize FacesContext.getCurrentInstance() calls part II
Date Tue, 22 May 2012 10:58:41 GMT


Leonardo Uribe resolved MYFACES-3550.

       Resolution: Fixed
    Fix Version/s: 2.1.8
> [perf] minimize FacesContext.getCurrentInstance() calls part II
> ---------------------------------------------------------------
>                 Key: MYFACES-3550
>                 URL:
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: JSR-314
>            Reporter: Leonardo Uribe
>            Assignee: Leonardo Uribe
>             Fix For: 2.0.14, 2.1.8
> It is still possible to minimize even more the number of calls to FacesContext.getCurrentInstance(),
just doing some small changes in some methods.
> For example, Application.createComponent(String componentType) has an internal call to
FacesContext.getCurrentInstance(), but the variant Application.createComponent(FacesContext
context, String componentType, String rendererType) does not, because it can be retrieved
from the parameter. Since rendererType can be null according to JSF spec, the result of both
methods is equivalent, so it is possible to use the second variant and save one call per component
that does not have rendererType.
> Other important place is when EL evaluation occur (FacesCompositeELResolver), FacesContext.getCurrentInstance()
is always called, but it is preferred to get the FacesContext from the ELContext first, because
a get over a map of 1 or 2 elements will be faster than a ThreadLocal lookup, which is proportional
to the number of threads running.

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