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

          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: