3 Replies Latest reply: Nov 10, 2016 7:58 PM by Paul Nowicki RSS

    Widget WebSocket Issue

    Paul Nowicki

      I created a Widget in Qlik Sense which allows for dynamic column labels.  However, when using this in a mashup, the widget breaks down into many small pieces and because Chrome has only 6 tcp socket connections per server available it creates a lot of stalled/queued loading time which slows down the initial load and performance of the mashup.  Notice in the attached screenshot, the widget is not just one call from require.js but broken into a ton of small calls.  Each call requires a tcp socket and after the first 6 are taken, subsequent requests are stalled/queued and overall load time for the mashup increases.  Users are waiting.  Can I bundle the widget into an object that requires only one tcp socket load?

       

      Capture.PNG

        • Re: Widget WebSocket Issue
          Paul Nowicki

          Also, why is Qlik.js 597kb.  Separate from the issue above, it seems like that is way too large.  Has anyone created a  qlik.js light version that can have features but load faster?

            • Re: Widget WebSocket Issue
              Paul Nowicki

              The root cause looks like in the widget code itself.  Since I use ng-repeat, I am hitting require.js for each cell in the table.  So in a table that is 6 x 4, I end up with 24 require.js calls.  This overwhelms the socket limit in Chrome of 6 tcp sockets at a time.  Creating the delay. 

               

              <table border="2">

                  <thead>

                  <tr>

                      <th ng-repeat="head in data.headers">

                            {{settings.customLabel.split(';')[$index]}}

                       </th>

                  </tr>

                  </thead>

                  <tbody>

                  <tr ng-repeat="row in data.rows">

                      <td ng-repeat="cell in row.cells">

                          {{cell.qText}}

                </td>

              </tr>

                <tr>

              <td class="totalclass">Total</td>

                <td class="totalclass" ng-repeat="total in data.totals">

                {{total.qText}}

                </td>

                  </tr></tbody>

              </table>

            • Re: Widget WebSocket Issue
              Paul Nowicki

              Separate from the issue above, we find that the websocket takes 12 seconds before the first object is returned from Qlik Sense to the mashup.  Is there a way to improve the performance of the websocket?