I'm using an UltraGrid to display a large amount of hierarchical information. When given a very large data set, things slow to a crawl, and it takes seconds for the grid to respond to mouse clicks. This slowness is not in my code, I've got click handlers and they don't get called until after the delay either. Profiling shows 45.15% of execution time being spent in OnCurrentChanged and another 39.07% in OnCurrentItemChanged.
As an example, I've got a set of data that produces the following output. The top and middle bands in this particular data set each have 5,000 total rows (one row in the middle band beneath each row in the top band). The bottom band has about 1,600,000 total rows, about 300 beneath each entry in the middle band. The delay in a mouse click and my click handler getting called is consistently two seconds with this data set.
Am I simply asking too much of the UltraGrid? The output is produced by an algorithm that can process all of the data in about two minutes, but a post processing step that walks over each of the rows in the bottom band, checking a value and applying a background color based on that value is so slow as to be unusable. In my testing, it took an average of 3.5 ms per row, and at 1.6M rows, that's about an hour and a half just to iterate over the rows of the bottom band. I have not profiled what's taking so long in this loop.
I've gotten around the problem for the next release cycle and eliminated the post processing step entirely, but we're only a few weeks away from the current release and my changes have been deemed too risky to be introduced this late in development, so if there's a solution to this slowness, I still need to implement that one too.
If UltraGrid just can't handle data sets this large, I can simply disable this post processing on large data sets, but I'd really prefer not to. Slimming down the data sets is also not an option (the information in the bottom band is critical), and our users occasionally have data sets even larger than the one I've been testing with.
Hello,
Could you please let me know the exactly version of Infragistics which you are using, also does your sample is consistent with UltraGrid Performance guide http://help.infragistics.com/Help/NetAdvantage/WinForms/2012.1/CLR2.0/html/WinGrid_Formatting_and_Appearance_based_Performance_Improvement.html http://help.infragistics.com/Help/NetAdvantage/WinForms/2012.1/CLR2.0/html/WinGrid_Memory_Usage.html
Could you please post your test application, in order to be able to investigate this further for you.
I am waiting for your feedback.
We're using Infragistics 2010 Vol. 2. Memory usage is fine, using only about 900MB total to process close to 2GB of data and display the results.
And yes, I call BeginUpdate before the function which iterates over the rows, and an EndUpdate afterward. I also do SuspendLayout, SuspendRowSynchronization and SuspendSummaryUpdates and their corresponding Resumes. I'm not sure if any of that is necessary or even detrimental.
Unfortunately, I cannot post the code. This is software for the DoD, and I'm sure I'd be fired immediately for posting the code here, or anywhere for that matter. The dataset contains information classified as "for official use only" and can't be posted either.
I can, however, tell you the general sequence of events.
1. The display collects a number of data sources to be processed and hands them over to a processing engine, which analyzes them asynchronously. At this time, the schema for the UltraGrid is initialized, but no data is populated yet. This is also where we set up our event handlers, styles, etc. and call the SuspendX methods.
2. The engine notifies the display when processing is complete and provides a DataSet with the results.
3. The display calls BeginUpdate, then sets the Grid's DataSource to the DataSet we just got back, and sets a sort order on one of the columns in the top band.
4. The display invokes the method which colors the rows as necessary. This method is blocking.
5. After the row coloring method returns, we call EndUpdate and the various ResumeX methods.
Also, do you have any information on the extremely large delay between clicking on the Grid and the click being registered? I did not mention before, but this delay only occurs when clicking on a different row. Clicking on the same row incurs no delay, and the event handlers fire instantly.