ICEfaces
  1. ICEfaces
  2. ICE-6130

Optimize add group member logic in SessionViewManager

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-Beta1
    • Fix Version/s: 2.0.0
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      ICEfaces 2, Auction

      Description

      Using the Auction monitor, I noticed an overhead of addGroupMember invocation. Basically, on every clock-tick the a request for auction.jsf is send out. Handling this request causes the following logic to be executed in the BridgeSetup class:

          public void processEvent(SystemEvent event) throws AbortProcessingException {
                  ...
                  if (EnvUtils.isICEpushPresent()) {
                      SessionViewManager.addView(context, viewID);
                      ...
                  }
                  ...

      The addView method of SessionViewManager is as follows:

          public static String addView(FacesContext context, String id) {
              PushContext pushContext = getPushContext(context);
              State state = getState(context);
              state.viewIDs.add(id);
              pushContext.addGroupMember(state.groupName, id);

              Iterator i = state.groups.iterator();
              while (i.hasNext()) {
                  pushContext.addGroupMember((String) i.next(), id);
              }
              return id;
          }

      Basically, this causes the addGroupMember to be invoked for the JSessionID as well as all groups used and defined by the application. The invocations are identical every clock tick, showing the overhead. This gets worse when EPS is in play as well, because of the JMS communication.

      SessionViewManager has an inner class properly called State. Maybe we should use the information contained in this class to optimize.

        Activity

        Hide
        Ted Goddard added a comment -

        PushRenderer should remove (on Session timeout) all PUSHIDs managed by the ICEfaces PushRenderer).

        Show
        Ted Goddard added a comment - PushRenderer should remove (on Session timeout) all PUSHIDs managed by the ICEfaces PushRenderer).
        Hide
        Jack Van Ooststroom added a comment -

        If the state.viewIDs already contains the id, it'll not be added again effectively avoiding the obsolete PushContext.addGroupMember invocations. Similar logic is applied to removeView as well. Marking this one as FIXED.

        Show
        Jack Van Ooststroom added a comment - If the state.viewIDs already contains the id, it'll not be added again effectively avoiding the obsolete PushContext.addGroupMember invocations. Similar logic is applied to removeView as well. Marking this one as FIXED.

          People

          • Assignee:
            Jack Van Ooststroom
            Reporter:
            Jack Van Ooststroom
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: