Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Clearing a ReportGrid Collapse All
Subject Author Date
Suhai Gyorgy Dec 17, 2007 - 4:38 AM

Dear Support,

We are using your CExtReportGridWnd control and now we are testing it with many items ( around 25,000 ). For clearing the grid we are using ItemRemove(ItemGetRoot(), true, true); This takes more than 90 seconds!!! That’s way too much for clearing! Could you look into how you could speed this up?

Thank you!

Technical Support Dec 20, 2007 - 5:50 AM

This behavior is explained by how the IMalloc is implemented in the CExtAlloc class. This class implements block based memory allocations and provides a memory managed API as a IMalloc interface pointer. Each CExtGridCell*** object stored in the CExtGridDataProviderMemory<code> data provider is instantiated using a specific version of C++ new operator defined in the <code>CExtGridCell class and this operator has the IMalloc interface pointer in its parameters. The memory data provider uses this memory allocation technique to improve cell allocation time. The de-allocation time can be very fast or very slow. If the de-allocated cell object is not the last in its block of cells, then de-allocation is fast. If the cell is last in its block, then de-allocation is slow. Besides, de-allocation time very depends on whether the report grid is grouped or not.

We think the grid control with more than 3 thousand rows should be a cacheable CExtGridWnd control rather than the CExtReportGridWnd control.

Technical Support Dec 18, 2007 - 3:41 AM

25000 rows is too much for the report grid control which is designed as in-memory grid only. You should use CExtReportGridWnd::ReportItemUnRegisterAll() or CExtReportGridWnd::ReportItemUnRegisterSelection() with it rather than CExtTreeGridWnd::ItemRemove(). We can analyze the code that unregisters report grid items, but we believe its performance can be improved only in the case of unregistering the entire set of report grid items and the real performance can be not faster than CExtGridWnd::RowRemoveAll() because destruction of cell objects takes its determined time.

Suhai Gyorgy Dec 18, 2007 - 4:14 AM

ReportItemUnRegisterAll uses the very same ItemRemove(ItemGetRoot(), true, bRedraw); code which we are using to clear the entire grid. So it doesn’t make any difference in this case.

Strange thing is that while loading the application (not only the grid) takes only 20 seconds, clearing the grid (and only the grid) still takes 90 seconds. Using CExtGridCellStringDM instead of CExtGridCellString didn’t make any difference either. Why does destruction take so much more time than construction?

Thank you!