ICEfaces
  1. ICEfaces
  2. ICE-7963

ace:dataTable - Unresponsive Script popup shown when loading large data

    Details

    • Assignee Priority:
      P2

      Description

      When trying to load a large set of data in a scrollable ace:dataTable an Unresponsive Script popup is shown in Firefox and IE. The issue is seen when loading 2000+ records. It also depends on how many columns are being rendered also. If using only 5 columns no popup is shown but when using 20+ columns in a table the popup notification is shown.

      1. Case10648Example7963.zip
        39 kB
        Arran Mccullough
      1. Also triggered again from ace-datatable.js.jpg
        163 kB
      2. First bottleneck.jpg
        132 kB
      3. Profiling results.jpg
        99 kB
      4. Second bottleneck.jpg
        119 kB
      5. Second bottleneck triggered from ace-datatable.js.jpg
        142 kB
      6. Triggered from ace-datatable.js.jpg
        168 kB
      7. unresponsive-script-popup-FF.jpg
        48 kB

        Activity

        Hide
        Arran Mccullough added a comment -

        Attached test case source code and screen shot of error.

        Show
        Arran Mccullough added a comment - Attached test case source code and screen shot of error.
        Hide
        Arran Mccullough added a comment -

        Attached test case sample.

        To reproduce issue:

        • Load noHeaderGroup.jsf
        • Click on Populate button
        • Click on Toggle Pagination button
        • Change the drop down to show 2000 records
        • Unresponsive script popup is shown in FF and the page is unresponsive while it loads.

        If you take scrolling off and load the same number of pages the popup isn't shown.

        Show
        Arran Mccullough added a comment - Attached test case sample. To reproduce issue: Load noHeaderGroup.jsf Click on Populate button Click on Toggle Pagination button Change the drop down to show 2000 records Unresponsive script popup is shown in FF and the page is unresponsive while it loads. If you take scrolling off and load the same number of pages the popup isn't shown.
        Hide
        Mircea Toma added a comment - - edited

        The profiling of the test case revealed that the bottleneck is triggered when the data table JS code uses the 'fadeTo' effect (defined in jQuery) or tries to re-arrange the table after a data scroll.

        The profiling results in http://jira.icesoft.org/secure/attachment/14329/Profiling+results.jpg show that line 6609 and 6420 will use 52% and respectively 27% of the processing time. Both bottlenecks are triggered when Element.offsetWidth or Element.offsetHeight properties are queried. See http://jira.icesoft.org/secure/attachment/14339/First+bottleneck.jpg and respectively http://jira.icesoft.org/secure/attachment/14337/Second+bottleneck.jpg .

        Line 6609 in jQuery code which corresponds to the jQuery.expr.filters.hidden function is indirectly invoked from ace-datatable.js at line 684 when the ':hidden' selector is used (see call stack in http://jira.icesoft.org/secure/attachment/14335/Triggered+from+ace-datatable.js.jpg ). Also at line 472 the data table code will invoke 'fadeTo' function which indirectly will reach jQuery.expr.filters.hidden again (see call stack in http://jira.icesoft.org/secure/attachment/14336/Also+triggered+again+from+ace-datatable.js.jpg ).

        The second bottleneck is triggered from the ace-datatable.js at line 733 when the column's width is queried ( see http://jira.icesoft.org/secure/attachment/14338/Second+bottleneck+triggered+from+ace-datatable.js.jpg ).

        Show
        Mircea Toma added a comment - - edited The profiling of the test case revealed that the bottleneck is triggered when the data table JS code uses the 'fadeTo' effect (defined in jQuery) or tries to re-arrange the table after a data scroll. The profiling results in http://jira.icesoft.org/secure/attachment/14329/Profiling+results.jpg show that line 6609 and 6420 will use 52% and respectively 27% of the processing time. Both bottlenecks are triggered when Element.offsetWidth or Element.offsetHeight properties are queried. See http://jira.icesoft.org/secure/attachment/14339/First+bottleneck.jpg and respectively http://jira.icesoft.org/secure/attachment/14337/Second+bottleneck.jpg . Line 6609 in jQuery code which corresponds to the jQuery.expr.filters.hidden function is indirectly invoked from ace-datatable.js at line 684 when the ':hidden' selector is used (see call stack in http://jira.icesoft.org/secure/attachment/14335/Triggered+from+ace-datatable.js.jpg ). Also at line 472 the data table code will invoke 'fadeTo' function which indirectly will reach jQuery.expr.filters.hidden again (see call stack in http://jira.icesoft.org/secure/attachment/14336/Also+triggered+again+from+ace-datatable.js.jpg ). The second bottleneck is triggered from the ace-datatable.js at line 733 when the column's width is queried ( see http://jira.icesoft.org/secure/attachment/14338/Second+bottleneck+triggered+from+ace-datatable.js.jpg ).
        Hide
        Mircea Toma added a comment -

        The conclusion is that we should avoid as much as possible calls into the jQuery API that will end up using the ':hidden' pseudo selector since none of the modern browsers support it natively, thus making its usage very slow. See also http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=jquery-performance-exp-110413194523-phpapp02&startSlide=7 .

        Show
        Mircea Toma added a comment - The conclusion is that we should avoid as much as possible calls into the jQuery API that will end up using the ':hidden' pseudo selector since none of the modern browsers support it natively, thus making its usage very slow. See also http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=jquery-performance-exp-110413194523-phpapp02&startSlide=7 .
        Hide
        Nils Lundquist added a comment - - edited

        Though :hidden pseudo-selector is slow, it is not as slow as the bottleneck implies. It was making repetitive calls due to being incorrectly used on the ancestors of the node to find if the node itself was hidden in turn, when :hidden checks for this case itself when called on the node.

        This had been fixed and now hidden is used only on the table. Cases of scrollable + thousands of rows + multiple columns still have delays associated with them.

        Show
        Nils Lundquist added a comment - - edited Though :hidden pseudo-selector is slow, it is not as slow as the bottleneck implies. It was making repetitive calls due to being incorrectly used on the ancestors of the node to find if the node itself was hidden in turn, when :hidden checks for this case itself when called on the node. This had been fixed and now hidden is used only on the table. Cases of scrollable + thousands of rows + multiple columns still have delays associated with them.
        Hide
        Nils Lundquist added a comment -

        Revision #28833
        Committed by nils.lundquist
        9 minutes ago
        ICE-7963 - Changed use of :hidden, had been unnecessarily been calling hidden for ancestors, when this case is included in calling :hidden for a descendant.

        Even after this change there is some delay (a great delay in Webkit) due to other bottlenecks. Closing this issue as the other major bottleneck (in FF) that Mircea had analyzed, the column width evaluation, has no possibilities for optimization.

        Show
        Nils Lundquist added a comment - Revision #28833 Committed by nils.lundquist 9 minutes ago ICE-7963 - Changed use of :hidden, had been unnecessarily been calling hidden for ancestors, when this case is included in calling :hidden for a descendant. Even after this change there is some delay (a great delay in Webkit) due to other bottlenecks. Closing this issue as the other major bottleneck (in FF) that Mircea had analyzed, the column width evaluation, has no possibilities for optimization.
        Hide
        Ken Fyten added a comment -

        Please add this commit to the icefaces-3.0.x-maintenance branch also.

        Show
        Ken Fyten added a comment - Please add this commit to the icefaces-3.0.x-maintenance branch also.
        Hide
        Nils Lundquist added a comment -

        Fix also applied to maintenance branch.

        Show
        Nils Lundquist added a comment - Fix also applied to maintenance branch.

          People

          • Assignee:
            Nils Lundquist
            Reporter:
            Arran Mccullough
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: