Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-6692

Page deserialization on websocket close - possible performance issue

    XMLWordPrintableJSON

Details

    Description

      We have a page with websocket connection (using WebSocketBehavior). When user navigates to another page, a websocket connection is closed and AbstractWebSocketProcessor.onClose method is called. This causes broadcasting a message to connected page:

       broadcastMessage(new ClosedMessage(getApplication(), getSessionId(), key));
      

      and leads to page deserialisation (from PageStore).
      I wonder how it can affect performance: almost every page navigation causes page deserialization (when it should occur only for back button or when some websocket message comes and application need to process it).
       
      Maybe this message should be send only when needed or maybe I should not care and current behaviour does not affect performance?
       
      I have attached a simple quick start:

      • click links to navigate between pages: “Nav 1” and “Home”,
      • after each click you can see “>> Closed message: …” on System.out (so closed message was sent),
      • AbstractWebSocketProcessor broadcast a ClosedMessage to a page, which causes its deserialization (you can debug IPageStore.getPage call).

      Attachments

        1. websocket-deser-onclose.zip
          29 kB
          Daniel Stoch

        Activity

          People

            mgrigorov Martin Tzvetanov Grigorov
            interface Daniel Stoch
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: