[ 
https://issues.apache.org/jira/browse/MYFACES-3160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13049449#comment-13049449
 ] 

Leonardo Uribe commented on MYFACES-3160:
-----------------------------------------

Attached corrected patch (MYFACES-3160-8) after commit solution for 
MYFACES-3169.

After thinking about this issue, the param to activate the this improvement 
works like this:

    /**
     * Indicates if expressions generated by facelets should be cached or not. 
Default is noCache. There there are four modes:
     * 
     * <ul>
     * <li>always: Only does not cache when expressions are inside user tags or 
the expression contains a variable resolved using VariableMapper</li>
     * <li>allowCset: Like always, but does not allow cache when ui:param was 
used on the current template context</li>
     * <li>strict: Like allowCset, but does not allow cache when c:set with var 
and value properties only is used on the current page context</li>
     * <li>noCache: All expression are created each time the view is built</li>
     * </ul>
     * 
     */
    @JSFWebConfigParam(since="2.0.8", defaultValue="noCache", 
expectedValues="noCache, strict, allowCset, always")
    public static final String INIT_PARAM_CACHE_EL_EXPRESSIONS = 
"org.apache.myfaces.CACHE_EL_EXPRESSIONS";

With the corrections done on c:set and ui:param, we can limit effectively the 
"scope" of the variables and detect early if we should cache it or not. The 
latest evidence shows it is not possible to set the improvement to other value 
than noCache by default, so the best is let the user decide to cache or not 
expressions, and the mode that applies for your project.

> [PERF] TagAttributeImpl part II: object allocations (cache ELExpressions)
> -------------------------------------------------------------------------
>
>                 Key: MYFACES-3160
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3160
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: JSR-314
>            Reporter: Leonardo Uribe
>            Assignee: Leonardo Uribe
>         Attachments: MYFACES-3160-1.patch, MYFACES-3160-2.patch, 
> MYFACES-3160-3.patch, MYFACES-3160-4.patch, MYFACES-3160-5.patch, 
> MYFACES-3160-8.patch
>
>
> See discussion on:
> http://markmail.org/message/kca64ojdvb6em367?q=%5Bcore%5D+performance:+TagAttributeImpl+part+II:+object+allocations

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to