Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
pnowicki
Creator
Creator

Widget WebSocket Issue

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

3 Replies
pnowicki
Creator
Creator
Author

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?

pnowicki
Creator
Creator
Author

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>

pnowicki
Creator
Creator
Author

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?