Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#5552 closed defect (fixed)

Grid page/row caching (for dojo.data), is broken on IE.

Reported by: Jared Jurkiewicz Owned by: sorvell
Priority: high Milestone: 1.2
Component: DojoX Grid Version: 1.0
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by Jared Jurkiewicz)

This is something I discovered while working with Grid and the dojox.grid.data.DojoData? model. When testing my app on both IE and FF, I found IE performance to be *horrible*. After a bit of investigation, it seems like grid is loading too much data on IE.

For example, I have instructed the grid to keep 60 rows. On dojox.grid.data.DojoData?, I instructed the model rowsPerPage is 20. When I run my app on FF (with a console.log() debug statement in processRows() of dojox.grid.data.DojoData?, here is what I see: Got items from the store: 20 Got items from the store: 20

So, it loaded the first two 'pages' of data ... 40 rows. Okay. Seems sane, though why it didn't load all 60 seems odd. But that's not the really strange problem. When I get to IE, it goes berserk. On IE I get this on startup: Got items from the store: 20 Got items from the store: 20 Got items from the store: 20 Got items from the store: 20 Got items from the store: 20 Got items from the store: 20 Got items from the store: 20 Got items from the store: 20 Got items from the store: 20 Got items from the store: 20 Got items from the store: 20 Got items from the store: 20 Got items from the store: 20 Got items from the store: 20 Got items from the store: 20

It loads 16 pages! For a total of 280 rows! This makes IE's load very, very, very slow. Not to mention scrolling becomes a nightmare. When I scroll enough and it starts another load (needs more data) ... it goes and grabs ... another 280 rows (16 pages).

Why is IE loading so much more than FireFox?? This causes some serious performance issues.

Attachments (1)

dojox.grid._grid.scroller_20080125.patch (1.4 KB) - added by Jared Jurkiewicz 11 years ago.
Patch to measurePage to get it to calculate a more reasonable default size for rows. (Particularly for IE, which performs terribly becuase of severe over-load of data)

Download all attachments as: .zip

Change History (6)

comment:1 Changed 11 years ago by Jared Jurkiewicz

I've tracked this down. It's caused by a function in dojox.grid.scroller. The function in question is 'measurePage'. What basically happens is that this function calculates the pixel height of a page of data. When the grid id pulling in data the first time, it calculates the height of a page of X rows, but there is no data yet in the divs. This then causes it to use some default div size from the browser. On FireFox? and Safari, the default is reasonable, each div is 8px high. But on IE, it comes back as 1 px. So, if your pages are set to 25 rows each, then initially it thinks a page only takes 25px on IE to display, on FireFox? or safari, it calculates this to 200px. Now, as you can see, with the same viewport size on IE and FireFox?, IE thinks it needs many more pages of data to fill a viewport. This is why it goes crazy spam-loading pages. In reality. the measurePage function needs to work better and provide a better page size estimate for IE so that it doesn't load so much extra data.

I've got a patch that significantly improves IE behavior in this area and makes the scrolling/paging across large datasets much more tolerable. I'll be attaching the patch shortly.

Changed 11 years ago by Jared Jurkiewicz

Patch to measurePage to get it to calculate a more reasonable default size for rows. (Particularly for IE, which performs terribly becuase of severe over-load of data)

comment:2 Changed 11 years ago by dylan

Milestone: 1.0.31.2

comment:3 Changed 11 years ago by Jared Jurkiewicz

Description: modified (diff)

1.2's rework of the grid loading seems to alleviate this issue. It doesn't try to parallel fetch all the initial 'thought to be needed' pages, but one page set at a time, so it can calculate off the previous gather to see how many more are needed.

comment:4 Changed 11 years ago by Jared Jurkiewicz

Resolution: fixed
Status: newclosed

This appears a lot better with 1.2 grid. So, closing.

comment:5 Changed 11 years ago by Jared Jurkiewicz

(In [14503]) Putting this in for compat. \!strict fixes #5552

Note: See TracTickets for help on using tickets.