We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Virtual Grid: BeginUpdate, and peformance question

Hi, I have a couple of questions on virtual grid usage and performance.
1) Is it ok to use BeginUpdate and EndUpdate on the GridControl when it is in virtual mode, to suspend painting while the underlying data is changing? If not what is the recomended way to temporarily stop the grid from trying to paint and later to resume?

2)Our data changes very frequently. On avg, once a second we have updates. To make the grid refresh, I am having to do a grid.Invalidate, This causes a CPU usage of 50% for a whole second (I usually have about 50 rows and 15 columns shown). Is this what you would normally expect? Can you suggest any way to optimize this? I tried the GridGDI example from the samples, but I got the same result.
The solution I am thinking of is to compute the values to be displayed, then compare with the value being shown currently (by having that in a buffer), and then do an invalidaterange for only the cells that have changed. Would you say this is a good strategy?
thanks and regards
Bijesh


9 Replies

JJ Jisha Joy Syncfusion Team August 29, 2008 09:50 AM UTC

Hi Bijesh,

Thank you for posting query to us.

Issue I:

Yes. It is OK. When many paints are made to the appearance of a control, you should invoke the BeginUpdate method to temporarily freeze the drawing of the control. This results in less distraction to the user, and a performance gain. After all updates have been made, invoke the EndUpdate method to resume drawing of the control.

Issue 2:

It is difficult to identify the issue without a working sample. Could you please update us with a minimal sample that shows the issue?. Also please look at the browser sample in the following location that is shipped with our products.
\\My Documents\Syncfusion\EssentialStudio\6.3.0.30\Windows\Grid.Windows\Samples\2.0\PerformanceSamples\RefreshGrid\cs

Regards,
Jisha



BR Bijeshnath Ravindranath August 29, 2008 02:42 PM UTC

Hi Jisha,
Thanks for your response. Regarding the second question, I am attaching a very simple example. I am not doing much there, just a virtual grid with 500 rows and 50 columns.
I am doing an invalidate every second. In the query cell info I am just setting some text, and every other row I am setting the backcolor as well. If you see the attached screenshot of performance monitor, the cpu usage is steady at around 60%.
Of course if I know exactly what cells to invalidate I can do an InvalidateRange.But I cannot do that since any part of the data may have changed. And the style settings like backcolor, etc also depend on the data in the real scenario.

My question is, is there anything I can do to optimize the Invalidate itself? Or do you think that a steady 50% cpu usage is expected if we invalidate the grid every second?

If so, how would you recommend optimising the performance of the invalidate. Would it be advisable to maintain a list of StyleInfo objects, and updating this list on data update, and invalidating only the cells that have changed? I am not sure in terms of memory usage if this is a good idea.

thanks,
Bijesh

>Hi Bijesh,

Thank you for posting query to us.

Issue I:

Yes. It is OK. When many paints are made to the appearance of a control, you should invoke the BeginUpdate method to temporarily freeze the drawing of the control. This results in less distraction to the user, and a performance gain. After all updates have been made, invoke the EndUpdate method to resume drawing of the control.

Issue 2:

It is difficult to identify the issue without a working sample. Could you please update us with a minimal sample that shows the issue?. Also please look at the browser sample in the following location that is shipped with our products.
\\My Documents\Syncfusion\EssentialStudio\6.3.0.30\Windows\Grid.Windows\Samples\2.0\PerformanceSamples\RefreshGrid\cs

Regards,
Jisha





SyncFGridPerformanceTest_691cca7.zip


JJ Jisha Joy Syncfusion Team September 1, 2008 11:03 AM UTC

Hi Bijesh,


Thank you for your update.


I have tested the sample in version 6.3.0.30. But I was not able to see the issue you have mentioned. Please refer the screen shot:

http://www.syncfusion.com/support/user/uploads/shot_93d91db1.zip

Could you please let me know which version you are using?

Regards,
Jisha



BR Bijeshnath Ravindranath September 2, 2008 12:54 PM UTC

Hi Jisha,
Thanks for the response. We are using version 4.4.0.51. I think one of the factors here is how much of the grid is visible. If you maximise the grid and observe for a few seconds you might see the CPU usage being higher. If it is minimised or restored to a smaller size the usage is not that significant
thanks and regards
Bijesh

>Hi Bijesh,


Thank you for your update.


I have tested the sample in version 6.3.0.30. But I was not able to see the issue you have mentioned. Please refer the screen shot:

http://www.syncfusion.com/support/user/uploads/shot_93d91db1.zip

Could you please let me know which version you are using?

Regards,
Jisha





JJ Jisha Joy Syncfusion Team September 4, 2008 09:48 AM UTC


Hi Bijesh,

Thank you for your update.

I was able to see the issue in v4.4.0.51. But the issue is no more existing in latest versions. Could you please conseider to upgrade to one of our latest version. You can download it from the below location:


http://www.syncfusion.com/downloads/product/versionhistory.aspx

Thanks,
Jisha



BR Bijeshnath Ravindranath September 4, 2008 12:43 PM UTC

Hi Jisha,
Yes, we can definitely upgrade. Can you be a bit more specific about the version? If we upgrade to version 5.x will we get the performance benifit? Our project is on Visual Studio 2005, so we can't go up to version 6, correct?
thanks,
Bijesh

>
Hi Bijesh,

Thank you for your update.

I was able to see the issue in v4.4.0.51. But the issue is no more existing in latest versions. Could you please conseider to upgrade to one of our latest version. You can download it from the below location:


http://www.syncfusion.com/downloads/product/versionhistory.aspx

Thanks,
Jisha





JJ Jisha Joy Syncfusion Team September 5, 2008 09:21 AM UTC

Hi Bijesh,

Thank you for considering upgrade.

You can make use of version 6.x.x.x since it is complatible with both VS 2005 and VS 2008.


You can refer the following details in the release notes:

http://www.syncfusion.com/support/releasenotes/default.aspx

Please let me know if you have aany questions.

Regards,
Jisha




BR Bijeshnath Ravindranath September 5, 2008 01:15 PM UTC

Hi Jisha,

Thanks for all the help. We will upgrade to 6.x, I will get back to you if there is any issues/update,etc.

thanks and regards,

Bijesh

>Hi Bijesh,

Thank you for considering upgrade.

You can make use of version 6.x.x.x since it is complatible with both VS 2005 and VS 2008.


You can refer the following details in the release notes:

http://www.syncfusion.com/support/releasenotes/default.aspx

Please let me know if you have aany questions.

Regards,
Jisha






BR Bijeshnath Ravindranath September 9, 2008 09:48 AM UTC

Hi Jisha,
I upgraded to version 6.1.0.34, and surprisingly, I got nearly same results as in 4.4. (attaching screenshot). However I did notice some interesting things.
Basically the usage seems to be really bad only in debug mode(around 60%). The two blue lines are debug modes. First is 4.4 and second is 6.1. In release mode the usage is around 20% (the yellow lines, first is 6.1 and second two lines are 4.4.
Can you please let me know if I might be doing something wtong here. As such it is difficult to justify an upgrade if there is no significant improvement.
Obviously I'm only concerned with the performance in release mode, and as such do you think it might be possible to opmtimize it beyond the 20%, or should I look for programatic ways (like doing invalidaterange, etc)?

thanks and regards
Bijesh

>Hi Jisha,

Thanks for all the help. We will upgrade to 6.x, I will get back to you if there is any issues/update,etc.

thanks and regards,

Bijesh

>Hi Bijesh,

Thank you for considering upgrade.

You can make use of version 6.x.x.x since it is complatible with both VS 2005 and VS 2008.


You can refer the following details in the release notes:

http://www.syncfusion.com/support/releasenotes/default.aspx

Please let me know if you have aany questions.

Regards,
Jisha








screenshot_cce0eb6e.zip

Loader.
Live Chat Icon For mobile
Up arrow icon