title: Performance Tests of Serializations used by WCF Bindings
body: <p>I have the following object:</p>
  
  <pre><code>public partial class Game
  {
      public bool Finished { get; set; }
  
      public Guid GameGUID { get; set; }
  
      public long GameID { get; set; }
  
      public bool GameSetup { get; set; }
  
      public Nullable&lt;int&gt; MaximumCardsInDeck { get; set; }
  
      public Player Player { get; set; }
  
      public Player Player1 { get; set; }
  
      public bool Player1Connected { get; set; }
  
      public bool Player1EnvironmentSetup { get; set; }
  
      public long Player1ID { get; set; }
  
      public int Player1Won { get; set; }
  
      public bool Player2Connected { get; set; }
  
      public bool Player2EnvironmentSetup { get; set; }
  
      public long Player2ID { get; set; }
  
      public int Player2Won { get; set; }
  
      public int Round { get; set; }
  
      public Nullable&lt;int&gt; RoundsToWin { get; set; }
  
      public bool Started { get; set; }
  
      public string StateXML { get; set; }
  
      public Nullable&lt;DateTime&gt; TimeEnded { get; set; }
  
      public Nullable&lt;int&gt; TimeLimitPerTurn { get; set; }
  
      public byte[] TimeStamp { get; set; }
  
      public Nullable&lt;DateTime&gt; TimeStarted { get; set; }    
  }
  </code></pre>
  
  <p>This class gonna be filled with some <strong>test data</strong>.</p>
  
  <p>I need the to compare the <strong>Performance</strong> of different Serializers used by the different forms of bindings for WCF Services:
  <UL>
  <LI>basicHttpBinding => <strong>SoapFormatter</strong> (TextFormatter?)
  <LI>binaryBinding => <strong>BinaryFormatter</strong>
  <LI><strong>XMLFormatter</strong>
  </UL></p>
  
  <p>What i need to do in detail is:
  <UL>
  <LI>Get to now the <strong>size</strong> of the Object being serialized 
  <LI>Get to now the <strong>size</strong> after serizlization
  <LI><strong>Time</strong> to serialize
  <LI><strong>Time</strong> to deserialize 
  </UL></p>
  
  <p>I already tried some stuff, but i am struggling a bit.
  Maybe there is already some simple code for this kind of measurement.</p>