title: TPL TaskFactory.FromAsync vs Tasks with blocking methods
body: <p>I was wondering if there were any performance implications between using TPL <code>TaskFactory.FromAsync</code> and using <code>TaskFactory.StartNew</code> on blocking versions of the methods. I'm writing a TCP server that will support no more than 100 concurrent connections. After writing code with the first option &amp; chaining multiple read &amp; write operations with continue with, I was left with ugly, hard to debug code. </p>
  
  <p>I believe writing code with the synchronous version &amp; then wrapping it with a Task would decrease complexity &amp; increase testability, but I'm worried about the performance implications of doing this.</p>
  
  <p>For example, are there any performance differences between these 2 calls:</p>
  
  <pre><code>NetworkStream stream;
  byte[] data;
  int bytesRead;
  
  //using FromAsync
  Task&lt;int&gt; readChunk = Task&lt;int&gt;.Factory.FromAsync (
        stream.BeginRead, stream.EndRead,
        data, bytesRead, data.Length - bytesRead, null);
  
  //using StartNew with blocking version
  Task&lt;int&gt; readChunk2 = Task&lt;int&gt;.Factory.StartNew(() =&gt; 
        stream.Read(data, bytesRead, data.Length - bytesRead));
  </code></pre>