Performance of Silverlight Datagrid in Silverlight 3 vs Silverlight 4 on a mac
I'm using Silverlight Beta 4 for a LOB application.
After finding out today that I'll have to wait perhaps 4 months to be able to de开发者_Python百科velop with SL4 on Visual Studio 2010 I'm thinking I need to downgrade my application to SL3 but thats another question.
The problem is I'm noticing absolutely abismal performance for simple datagrids that work just fine on a PC when I'm running on a Mac. These grids contain only 5-10 columns and maybe 50 rows. Paging up and down takes about 1-2 seconds sometimes.
I would appreciate anybody's experience in which of the following is the best solution:
- reverting to Silverlight 3 and hoping DataGrid is faster
- switching to 3rd party datagrid such as Telerik
- forgetting silverlight altogether
I was hoping that possibly SL4 runtime might be updated but that won't happen probably for 3-4 months.
Just a reminder - this is specifically a mac issue. Performance on my PC while slightly slow to populate the grid initially is fine.
Do you see the same type of performance issues if you run your application in windowless mode on your PC? The Silverlight plugin always runs as windowless on the Mac, and I am thinking that might be the culprit of your performance issues. Windowless mode delegates rendering to the browser which requires interleaving of browser/plugin content for every frame. This can be computationally expensive and cause performance issues for certain applications. More on limitations of windowless mode here.
If you see the performance issues in windowless mode on the PC, I would argue that SL3 vs SL4 would not make a difference, and you will be stuck optimizing in other ways. Also, are you using the UI Virtualization available on the DataGrid?
I have just finished doing a trial between the grids of several major vendors, and the Microsoft and Telerik grids both came through very well performance wise (they were both very similar timings when it came to rendering bound data, sorting, etc).
So i would suggest that your performance issue is related specifically to SL4, not to the component - changing to a third party grid, while it will look prettier than the MS grid, will not solve your issue.
I'm seeing the same performance difference. Fast scrolling on Windows. Slow scrolling on Mac.
I set the windowless=true as a parameter:
<object id="xaml" data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
<param name="windowless" value="true" />
</object>
Doesn't make any difference.
Haven't yet been able to test this on the mac, but setting FrameRate to a low value dramatically reduces the CPU usage on Windows. Hoping redrawing unnecessarily many times a second is why it is sluggish on the mac.
Application.Current.Host.Settings.MaxFrameRate = 15; // or lower
After installing the Windows Phone 7 SDK (Windows Phone 7 uses SL 4), I seem to have the option to create Silverlight 4 projects in VS 2010 RC... At least, I can create a new Silverlight project, and in the project properties, it defaults to "Silverlight 4" as the Target Silverlight Version.
Silverlight 4 RTM appears to have significantly improved performance of DataGrid on Mac. There is now no discernable difference between Mac and PC for roughly equivalent machines.
YAY!
Changes in RTM have also significantly reduced the CPU usage when a complex silverlight datagrid is just sitting there doing nothing.
精彩评论