Announcement

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

    [Bug] Significant performance issue on Chrome with DateItem in an editable ListGrid

    Hi there,

    We are currently working with the latest released version (4.0) of SmartGWT and have had the following issue reported by our customers. A full decoupled test case can be found below the explanation of the issue.

    Situation
    When editing a value in an editable ListGrid on a ListGridField that is of ListGridFieldType.DATE, upon pressing 'ok' on the pop-up date chooser there is a significant freeze on Chrome. The length of the freeze is directly proportional to the number of records currently in the grid. This is not an issue in Internet Explorer 9 or Firefox. This issue also occurs if you are providing DateItem instances via a ListGridEditorCustomizer, so the assumption would be it is a browser specific issue with the DateItem implementation rather than with ListGrid.

    Test Case
    Code:
    import java.util.HashSet;
    
    import com.smartgwt.client.types.ListGridFieldType;
    import com.smartgwt.client.widgets.form.fields.DateItem;
    import com.smartgwt.client.widgets.grid.ListGrid;
    import com.smartgwt.client.widgets.grid.ListGridField;
    import com.smartgwt.client.widgets.grid.ListGridRecord;
    
    /**
     * Demonstrating the severe performance issues involved in loading an editable grid
     * relying on {@link DateItem} instances to handle cell editing in Chrome.
     * 
     * @author Liam
     *
     */
    public class DateItemPerformance extends ListGrid {
    
       public DateItemPerformance() {
          super();
          setSize("100%", "100%");
          setCanEdit(true);
          initFields();
          setSpoofData();
       }
       
       protected void initFields() {
          ListGridField nameField = new ListGridField("name", "Name");
          nameField.setCanEdit(false);
          
          ListGridField dateField = new ListGridField("date", "Date");
          dateField.setType(ListGridFieldType.DATE);
          
          setFields(nameField, dateField);
       }
       
       protected void setSpoofData() {
          HashSet<ListGridRecord> records = new HashSet<ListGridRecord>();
          
          for (int i = 0; i < 100; i++) {
             ListGridRecord testRecord = new ListGridRecord();
             testRecord.setAttribute("name", "Test Record " + i);
             testRecord.setAttribute("date", System.currentTimeMillis());
             records.add(testRecord);
          }
          
          setData(records.toArray(new ListGridRecord[0]));
       }
    }
    Last edited by Fox; 17 Jul 2013, 06:16.

    #2
    We've seen a similar report here which suggests a native bug in Chrome. You can use Chrome's developer tools to confirm that, during the odd delay, there's no JavaScript actually running; native code within the browser is running.

    Currently, we don't plan to try to find a workaround (which would really involve searching blindly for a possible cause) and will wait for the problem to be fixed in Chrome itself.

    Comment

    Working...
    X