No announcement yet.
  • Filter
  • Time
Clear All
new posts

    IE Alert: Script Running Slow, Stop Yes/No?

    Using SmartGWTEE 2.3 eval w/ IE7, in Eclipse.

    Playing around w/ Built-In-DS demo project:
    ■ Used adminConsole to setup a connection to a MS SQL 2005 test db. Set it as the default.
    ■ Used the DS Generator utility to export a table as a .ds.xml DataSource definition file to the /war/builtinds/ds folder project. No primary key defined, if that matters (I'm only doing fetch at this time).
    ■ The listGrid in the Built-In-DS project now retrieves data and populates from the SQL 2005 table. Success, kinda.

    If I scroll the table, it works, but it's very slow.

    However, if I select a record, it provokes an IE error:
    "Stop running this script? A script on this page is causing IE to run slowly. If it continues to run, your computer may become unresponsive." Yes/No

    Whether I click "Yes" or "No," this error occurs with every record selection event.

    The Developer Console does not appear to report any errors, e.g.
    09:28:24.329:MDN7:DEBUG:EventHandler:Bubbling event 'prepareForDragging', target '[GridBody ID:isc_ListGrid_1_body]' has handler: Canvas.prepareForDragging()
    09:28:24.329:MDN7:DEBUG:EventHandler:Bubbling event 'prepareForDragging', target '[ListGrid ID:isc_ListGrid_1]' has handler: Canvas.prepareForDragging()
    09:28:24.329:MDN7:DEBUG:EventHandler:Bubbling event 'prepareForDragging', target '[VStack ID:isc_VStack_0]' has handler: Canvas.prepareForDragging()
    09:28:24.329:MDN7:DEBUG:EventHandler:Event 'prepareForDragging' bubbled to top
    09:28:24.329:MDN7:DEBUG:EventHandler:No dragTarget, not dragging
    09:28:24.345:MDN7:DEBUG:Selection:isc_ListGrid_1_selection:selectOnMouseDown: recordNum: 280
    At this point, IE launches the alert dialog. But the Dev Console doesn't report anything additional.

    So, a couple questions:
    1) How to address this "slow script" issue directly?
    2) More broadly, why is the listGrid performance so slow? How would a production SmartGWT setup differ from what I'm doing now? I.e., everything's running on my desktop PC now. In production, which parts get moved to a Java server? Can I expect to see a performance improvement?


    We see this all the time with IE. Here is a Registry fix that bumps the 'slow script' threshold up further, so that annoying dialog won't come up as much:

    [HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Styles]


      You should only see "script running slowly" if you are connecting to a table with >2 million rows and only in IE. This is due to a flaw in IE that involves launching the script running slowly dialog based on a fixed number of instructions being executed (in other words, this dialog can be made to appear within 200ms of JavaScript execution and making the code faster can make the dialog appear sooner).

      In this situation we recommend using the Progressive Loading strategy covered in the ResultSet docs, which is also the right approach to minimize database load - there's no good reason to obtain a definitive row count with a result that large. In the future this will be the default behavior of SQLDataSource.



        I am seeing the same issue even though I am not trying to access table with large row count. I am invoking a DB update, which takes 2-5 seconds to update. The update happens fine, but the slow script error shows up in IE.

        Can you suggest a remedy?


          You can see many examples of successful updates across the Showcase with no such problems. It's something in your code, not the framework. A common error is to call invalidateCache() and then inadvertently iterate over all rows while the cache is invalid. See ResultSet.lengthIsKnown() and the FAQ on grids not updating automatically.


            Hello Isomorphic,

            I think the problem happens only for IE8, the update of grid iterates over the grid content, each row in turn triggers multiple updates in different tables. the time for all the updates is more than 2s-3s. After sometime the slow script error pops up, this happens only for IE. This does not happen for FireFox.



              This still doesn't enable us to help you any further. Once again, this use case will not cause a script running slowly dialog, as you can see in the Showcase.
              So you have problems in your code. We suggested one such problem already (iterating through a ResultSet when it hasn't loaded data yet). If you need more help, post as much code as you can and we can review it for obvious errors - for a definite solution show minimal code that we can actually run, so we can point out the problem.


                Same issue in Showcase

                Here the steps to reproduce the "script running slowly dialog" in the SmatGWT Showcase (using IE 8)

                1. Open:

                2. Select 300 records.
                - Click in the record 0
                - Scrolling to the record 300
                - Select the record 300 using Shift + click

                3. A "script running slowly dialog" will be displayed