views:

1215

answers:

6

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 develop 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.

+1  A: 

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.

slugster
+2  A: 

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?

Dan Auclair
not using UI virtualization. i'm not at the mac right now, but I'm pretty sure it can run either in the browser or out-of-browser. i'll check if the performance is different in either mode
Simon_Weaver
What I'm talking about has nothing to do with out-of-browser. It is the windowless mode property, where you can set windowless = true as a param to the object tag that hosts the Silverlight XAP. I am saying that no matter what you set, the plugin will run in windowless mode on a Mac which has performance drawbacks. My suggestion was to set windowless = true as a test on your PC to see if you see the same performance problems.
Dan Auclair
+1  A: 

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.

Matt
silverlight 4? have you tried in 3 and/or 4 ?
Simon_Weaver
@matt tried the silverlight RTM final release?
Simon_Weaver
A: 

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
Simon_Weaver
didn't seem to make much difference on mac - but improved performance on windows
Simon_Weaver
no longer seems to matter on SL4 RTM. looks like it's much more intelligent than before in not redrawing itself unnecessarily
Simon_Weaver
A: 

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.

Joel Mueller
downvoter - using SL4 with VS2010 was part of the question. Was something I said incorrect?
Joel Mueller
A: 

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.

Simon_Weaver