Announcement

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

    ListGrid draw performance

    Using:
    SmartGWT 3.1p-2012-11-23
    FF 19.0

    I created ListGrid with 3 columns, and loaded it with ~50 records via addData (). I am running in devmode.

    If I load the grid in a tight loop, calling addData () for each record, it loads in ~3 seconds.

    If I load the grid 1 record at a time, but each loaded deferred with the following, where a record is added, then the next record is scheduled for deferred execution, then after that record is added, it schedules the next record for deferred execution, and so on... it takes 20+ seconds:
    Code:
        final Scheduler scheduler = Scheduler.get ();
        scheduler.scheduleDeferred (new Scheduler.ScheduledCommand() {
          public void execute() {
            ... addData (...);
          }
        });
    From reading here and there, I was under the impression that SmartGWT did the drawing in a timer, and as such I would expect that the deferred loading would either collapse to perform the same as a tight-loop, or possibly I would see the grid drawing a few records at a time, but more quickly than when compare to a tight-loop.

    But it is not the case.
    Does this make sense?
    Can anybody explain how it does work?

    Also, could other things impact this, such as calling this, for example?
    Code:
    ListGrid.setAutoFitFieldWidths (true);
    Last edited by shortpasta; 24 Apr 2013, 17:49. Reason: Fixed title
Working...
X