title: C# string to byte array speed
body: <p>So coming off of this question:</p>
  
  <p><a href="https://stackoverflow.com/questions/1917427/which-is-fast-comparison-convert-toint32stringvalue-intvalue-or-stringvalue">Which is fast comparison: Convert.ToInt32(stringValue)==intValue or stringValue==intValue.ToString()</a></p>
  
  <p>I am looking a base type for my networked application to be stored in packets.  </p>
  
  <p><strong>The Idea:</strong></p>
  
  <ol>
  <li>Packet class stores a <code>list</code> of <code>(type)</code></li>
  <li>Add objects to the packet class</li>
  <li>Serialize and send it between machines</li>
  <li>Deserialize into <code>(type)</code></li>
  <li>Convert <code>(type)</code> into the type of object you added originally.</li>
  </ol>
  
  <p>Originally, I was using <code>strings</code> as <code>(type)</code>. However, I am a bit dubious as every time I want to convert an <code>int</code> to a <code>string</code>, it seems like a tasking process.  When I am communicating packets containing lots of <code>uints</code> to <code>strings</code> at 30FPS, I would like to make this process as fast as possible.</p>
  
  <p>Therefore, I was wondering if <code>byte[]</code> would be a more suitable type.  How fast is converting back and forth between a <code>byte[]</code> and <code>ints/strings</code> vs just <code>strings</code> to <code>ints</code>? BTW, I will not be sending a lot of strings on the network very often. Almost all of what I will be sending will be <code>uints</code>.</p>