SourceGrid Optimization story
April 6, 2010
Today I was playing around with SourceGrid. I noticed that for some reason simply resizing the window would cause the window to flicker, even though the data store was not beeing accessed.
The problem was in the fact that GetTotalHiddenRows method was a linear implementation, simply looping through all the rows. Even though the dataset was not that big (60k rows), that caused a lot of troubles.
The problem was fixed by implementing a simple ref-counting. That is, the moment the row became hidden, it produced an event. That event was caught by hidden rows calculator, which exposed a simple property TotalHiddenRows.
The result can be seen in this dotTrace image:
We can see a reduction in calls to PingGridRows.GetCount by 1 million, and GridVirtual.GetFixedRows by 2 million.
That solved this issue
