javaserverfaces-spec-public
  1. javaserverfaces-spec-public
  2. JAVASERVERFACES_SPEC_PUBLIC-941

reduce number of times rendered attribute value expression is evaluated

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Won't Fix
    • Affects Version/s: 2.2
    • Fix Version/s: None
    • Component/s: Components/Renderers
    • Labels:
      None
    • Status Whiteboard:
      Hide

      size_medium importance_medium

      Show
      size_medium importance_medium

      Description

      The rendered attribute is an Achilles heal of JSF performance. JSF abuses the
      value expression used in rendered attributes. It's expected that the value
      expression is going to be resolved more than once on a request because by nature
      it is a pass-through construct and because the value it is representing is
      likely contextual (meaning it can change as the application changes). However,
      in the case of the render attribute, it's a little bit out of control. Any
      getter method bound to a rendered attribute is being called way too many times.
      This could easily be solved by being more frugal about when it is consulted.

      For example, the rendered value expression is resolved in encodeChildren,
      encodeBegin (or encodeParentAndChildren) and again at encodeEnd of most
      components. We should state that when a component is first addressed during
      encoding (perhaps in encodeBegin) that is when the rendered attribute should be
      evaluated. Then the resolved value simply cannot change again in that phase.
      (The exception would be a row in UIData, which the rendered attribute would need
      to be resolved once per component per row).

      We should also consider having encodeAll check the rendered attribute and not
      encodeBegin. Or, we could keep the current contract the same but deprecate
      encodeBegin, encodeChildren, encodeEnd and getRendersChildren so that most
      people start using encodeAll instead so that isRendered gets called only once
      per component per render phase execution.

        Activity

        Hide
        Manfred Riem added a comment -

        As per EG discussion I am closing this as "Won't fix".

        Show
        Manfred Riem added a comment - As per EG discussion I am closing this as "Won't fix".
        Hide
        Manfred Riem added a comment -

        Setting priority to Critical

        Show
        Manfred Riem added a comment - Setting priority to Critical
        Hide
        Ed Burns added a comment -

        Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.

        Show
        Ed Burns added a comment - Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.
        Hide
        Ed Burns added a comment -

        Set fixVersion to 2.3. I think this may be better handled by having a way to advise the EL to start caching expression evaluations for the current thread and have a way to turn off that caching at the end of the JSF lifecycle.

        Show
        Ed Burns added a comment - Set fixVersion to 2.3. I think this may be better handled by having a way to advise the EL to start caching expression evaluations for the current thread and have a way to turn off that caching at the end of the JSF lifecycle.

          People

          • Assignee:
            Manfred Riem
            Reporter:
            rogerk
          • Votes:
            15 Vote for this issue
            Watchers:
            14 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 3 days
              3d
              Remaining:
              Remaining Estimate - 3 days
              3d
              Logged:
              Time Spent - Not Specified
              Not Specified