title: Correctly using .AsParallel() efficiently with linq
body: <p>I have a tuple and I am iterating over it with LINQ</p>
  
  <pre><code>List&lt;Tuple&lt;string[], double[]&gt;&gt; tt = new List&lt;Tuple&lt;string[], double[]&gt;&gt;();
  
  var t1 = new Tuple&lt;string[], double[]&gt;(
      new string[] { "java", "c#", "nn" },
      new double[] { 2, 3, 0 });
  
  var t2 = new Tuple&lt;string[], double[]&gt;(
      new string[] { "java", "c#", "nn" },
      new double[] { 0, 3, 1 });
  
  var t3 = new Tuple&lt;string[], double[]&gt;(
      new string[] { "java", "c#", "nn" },
      new double[] { 2, 1, 0 });
  
  tt.Add(t1);
  tt.Add(t2);
  tt.Add(t3);  
  
  var XX = (from tuples in tt
            let rows = tuples.Item2.ToArray()
            let result = rows.Select(x =&gt; x/rows.Count(i =&gt; i != 0)).ToArray()
           select new Tuple&lt;string[], double[]&gt;(tuples.Item1, result)
         ).ToList();
  </code></pre>
  
  <p>If I want to use the <code>.Asparallel</code> I can do one of the following ways:</p>
  
  <p>I can added it when looping over the list:</p>
  
  <pre><code>        var XX = (from tuples in tt
                    .AsParallel() //Parallel added here
                    let rows = tuples.Item2.ToArray()
                    let result = rows.Select(x =&gt; x/rows.Count(i =&gt; i != 0)).ToArray()
                   select new Tuple&lt;string[], double[]&gt;(tuples.Item1, result)
                 ).ToList();
  </code></pre>
  
  <p>I can add it when converting stuff using <code>.ToArray()</code> or <code>.ToList</code></p>
  
  <pre><code>        var XX = (from tuples in tt
  
                    let rows = tuples.Item2.ToArray()
                    let result = rows.Select(x =&gt; x / rows.Count(i =&gt; i != 0)).AsParallel().ToArray() //Parallel added right here
                   select new Tuple&lt;string[], double[]&gt;(tuples.Item1, result)
                 ).ToList();
  </code></pre>
  
  <p>What is the most efficient way to use <code>.Asparallel</code>? All of these methods give no errors but I am not sure if they effect performance.</p>
  
  <p>And is adding <code>.Asparallel</code> like this a bad idea?:</p>
  
  <pre><code>        var XX = (from tuples in tt
                    .AsParallel() //added here
                    let rows = tuples.Item2.AsParallel().ToArray() //here
                    let result = rows.Select(x =&gt; x / rows.Count(i =&gt; i != 0)).AsParallel().ToArray()//here
                   select new Tuple&lt;string[], double[]&gt;(tuples.Item1, result)
                 ).AsParallel().ToList(); // and here
  </code></pre>