title: Google Chrome Silverlight Performance Is Significantly Slow
body: <p>Chrome Silverlight rendering is very slow (estimation: 10 times slower) comparing to firefox and internet explorer.
  You can test this simply using following sample code. Sample code demonstrates 15000 random data rendering inside a data grid.</p>
  
  <p>Do you have any opinion why this is happening? 
  There are 2 speculations came to my mind.</p>
  
  <ol>
  <li>Google does not want Microsoft's Silverlight gather wide usage on their platform.</li>
  <li>Chrome's infrastructure somehow causes plugin rendering slow.</li>
  </ol>
  
  <p>XAML part:</p>
  
  <pre><code>&lt;UserControl x:Class="sample.view.MemberView"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"    
      xmlns:viewmodel="clr-namespace:sample.ViewModel"
      mc:Ignorable="d"
      &gt;
      &lt;UserControl.Resources&gt;
          &lt;viewmodel:MemberViewModel x:Key="viewModel"/&gt;
      &lt;/UserControl.Resources&gt;
      &lt;Grid x:Name="LayoutRoot" VerticalAlignment="Stretch" DataContext="{Binding Source={StaticResource viewModel}}"&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition&gt;&lt;/RowDefinition&gt;
              &lt;RowDefinition Height="35"&gt;&lt;/RowDefinition&gt;
          &lt;/Grid.RowDefinitions&gt;
          &lt;data:DataGrid BorderThickness="1" ItemsSource="{Binding Members}" VirtualizingStackPanel.VirtualizationMode="Recycling"&gt;
              &lt;data:DataGrid.Columns&gt;
                  &lt;data:DataGridTextColumn Header="Name" Width="3*" Binding="{Binding FirstName}"/&gt;
                  &lt;data:DataGridTextColumn Header="Surname" Width="3*" Binding="{Binding LastName}"/&gt;
                  &lt;data:DataGridTextColumn Header="GSM" Width="3*" Binding="{Binding MobilePhone}"/&gt;
                  &lt;data:DataGridTextColumn Header="Email" Width="3*" Binding="{Binding Email}"/&gt;
                  &lt;data:DataGridTextColumn Header="BirthDate" Width="2*" Binding="{Binding BirthDate}}"/&gt;
              &lt;/data:DataGrid.Columns&gt;
          &lt;/data:DataGrid&gt;
          &lt;StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="1"&gt;
              &lt;Button Content="Get Random Data" Width="120" Height="25" Margin="5" Command="{Binding GetRandomDataCommand}"/&gt;
          &lt;/StackPanel&gt;
      &lt;/Grid&gt;
  &lt;/UserControl&gt;
  </code></pre>
  
  <p>C# Part:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Collections.ObjectModel;
  using System.ComponentModel;
  using System.Net;
  using System.Text;
  using System.Windows;
  using System.Windows.Browser;
  using System.Windows.Controls;
  using System.Windows.Documents;
  using System.Windows.Ink;
  using System.Windows.Input;
  using System.Windows.Media;
  using System.Windows.Media.Animation;
  using System.Windows.Shapes;
  
  namespace sample.ViewModel
  {
      public class MemberModel
      {
          public string FirstName { get; set; }
  
          public string LastName { get; set; }
  
          public string MobilePhone { get; set; }
  
          public string Email { get; set; }
  
          public DateTime BirthDate { get; set; }
      }
  
      public class MemberViewModel
      {
          private List&lt;MemberModel&gt; _members;
          public List&lt;MemberModel&gt; Members
          {
              get
              {
                  return _members;
              }
              set
              {
                  _members = value;
                  RaisePropertyChanged(new PropertyChangedEventArgs("Members"));
              }
          }
          public MyCommand GetRandomDataCommand { get; set; }
  
          public MemberViewModel()
          {
              GetRandomDataCommand = new MyCommand();
          }
      }
  
      public class MyCommand : ICommand
      {
          public bool CanExecute(object parameter)
          {
              return true;
          }
  
          public event EventHandler CanExecuteChanged;
  
          private static Random random = new Random();
          public void Execute(object parameter)
          {
              List&lt;MemberModel&gt; members = new List&lt;MemberModel&gt;();
              for (int i = 0; i &lt; 15000; ++i)
              {
                  MemberModel m = new MemberModel();
                  m.FirstName = GetRandomString(random.Next(5) + 4);
                  m.LastName = GetRandomString(random.Next(5) + 4);
                  m.Email = GetRandomString(random.Next(10) + 4);
                  m.MobilePhone = GetRandomString(random.Next(12));
                  m.BirthDate = DateTime.Now.AddYears(-random.Next(50) - 18).AddMonths(random.Next(12)).AddDays(random.Next(30));
                  members.Add(m);
              }
          }
  
          private string GetRandomString(int length)
          {
              StringBuilder srb = new StringBuilder();
              for (int i = 0; i &lt; length; ++i)
              {
                  srb.Append((char)(65 + random.Next(29));
              }
              return srb.ToString();
          }
      }
  
  }
  </code></pre>