title: StorageFile 50 times slower than IsolatedStorageFile
body: <p>I was just benchmarking multiple algorithms to find the fastest way to load all data in my app when I discovered that the WP7 version of my app running on my Lumia 920 loads the data 2 times as fast as the WP8 version running on the same device.</p>
  
  <p>I than wrote the following independent code to test performance of the StorageFile from WP8 and the IsolatedStorageFile from WP7.</p>
  
  <p>To clarify the title, here my preliminary benchmark results I did, reading 50 files of 20kb and 100kb:</p>
  
  <p><img src="https://i.stack.imgur.com/cZSXN.png" alt="enter image description here"></p>
  
  <p>For the code, see below</p>
  
  <h2>Update</h2>
  
  <p>After doing benchmarks for a few hours today and some interesting results, let me rephrase my questions:</p>
  
  <ol>
  <li><p>Why is <code>await StreamReader.ReadToEndAsync()</code> consistently slower in every benchmark than the non async method <code>StreamReader.ReadToEnd()</code>? (This might already be answered in a comment from Neil Turner)</p></li>
  <li><p>There seems to be a big overhead when opening a file with StorageFile, but only when it is opened in the UI thread. (See difference in loading times between method 1 and 3 or between 5 and 6, where 3 and 6 are about 10 times faster than the equivalent UI thread method)</p></li>
  <li><p>Are there any other ways to read the files that might be faster?</p></li>
  </ol>
  
  <h2>Update 3</h2>
  
  <p>Well, now with this Update I added 10 more algorithms, reran every algorithm with every previously used file size and number of files used. This time each algorithm was run 10 times. So the raw data in the excel file is an average of these runs. As there are now 18 algorithms, each tested with 4 file sizes (1kb, 20kb, 100kb, 1mb) for 50, 100, and 200 files each (18*4*3 = 216), there were a total of 2160 benchmark runs, taking a total time of 95 minutes (raw running time).</p>
  
  <h2>Update 5</h2>
  
  <p>Added benchmarks 25, 26, 27 and <code>ReadStorageFile</code> method. Had to remove some text because the post had over 30000 characters which is apparently the maximum. Updated the Excel file with new data, new structure, comparisons and new graphs.</p>
  
  <p>The code:</p>
  
  <pre><code>public async Task b1LoadDataStorageFileAsync()
  {
      StorageFolder data = await ApplicationData.Current.LocalFolder.GetFolderAsync("benchmarks");
      data = await data.GetFolderAsync("samplefiles");
      //b1 
      for (int i = 0; i &lt; filepaths.Count; i++)
      {
          StorageFile f = await data.GetFileAsync(filepaths[i]);
          using (var stream = await f.OpenStreamForReadAsync())
          {
              using (StreamReader r = new StreamReader(stream))
              {
                  filecontent = await r.ReadToEndAsync();
              }
          }
      }
  }
  public async Task b2LoadDataIsolatedStorage()
  {
      using (var store = IsolatedStorageFile.GetUserStoreForApplication())
      {
          for (int i = 0; i &lt; filepaths.Count; i++)
          {
              using (var stream = new IsolatedStorageFileStream("/benchmarks/samplefiles/" + filepaths[i], FileMode.Open, store))
              {
                  using (StreamReader r = new StreamReader(stream))
                  {
                      filecontent = r.ReadToEnd();
                  }
              }
          }
      }
      await TaskEx.Delay(0);
  }
  
  public async Task b3LoadDataStorageFileAsyncThread()
  {
      StorageFolder data = await ApplicationData.Current.LocalFolder.GetFolderAsync("benchmarks");
      data = await data.GetFolderAsync("samplefiles");
  
      await await Task.Factory.StartNew(async () =&gt;
      {
          for (int i = 0; i &lt; filepaths.Count; i++)
          {
  
              StorageFile f = await data.GetFileAsync(filepaths[i]);
              using (var stream = await f.OpenStreamForReadAsync())
              {
                  using (StreamReader r = new StreamReader(stream))
                  {
                      filecontent = await r.ReadToEndAsync();
                  }
              }
          }
      });
  }
  public async Task b4LoadDataStorageFileThread()
  {
      StorageFolder data = await ApplicationData.Current.LocalFolder.GetFolderAsync("benchmarks");
      data = await data.GetFolderAsync("samplefiles");
  
      await await Task.Factory.StartNew(async () =&gt;
      {
          for (int i = 0; i &lt; filepaths.Count; i++)
          {
  
              StorageFile f = await data.GetFileAsync(filepaths[i]);
              using (var stream = await f.OpenStreamForReadAsync())
              {
                  using (StreamReader r = new StreamReader(stream))
                  {
                      filecontent = r.ReadToEnd();
                  }
              }
          }
      });
  }
  public async Task b5LoadDataStorageFile()
  {
      StorageFolder data = await ApplicationData.Current.LocalFolder.GetFolderAsync("benchmarks");
      data = await data.GetFolderAsync("samplefiles");
      //b5
      for (int i = 0; i &lt; filepaths.Count; i++)
      {
          StorageFile f = await data.GetFileAsync(filepaths[i]);
          using (var stream = await f.OpenStreamForReadAsync())
          {
              using (StreamReader r = new StreamReader(stream))
              {
                  filecontent = r.ReadToEnd();
              }
          }
      }
  }
  public async Task b6LoadDataIsolatedStorageThread()
  {
      using (var store = IsolatedStorageFile.GetUserStoreForApplication())
      {
          await Task.Factory.StartNew(() =&gt;
              {
                  for (int i = 0; i &lt; filepaths.Count; i++)
                  {
                      using (var stream = new IsolatedStorageFileStream("/benchmarks/samplefiles/" + filepaths[i], FileMode.Open, store))
                      {
                          using (StreamReader r = new StreamReader(stream))
                          {
                              filecontent = r.ReadToEnd();
                          }
                      }
                  }
              });
      }
  }
  public async Task b7LoadDataIsolatedStorageAsync()
  {
      using (var store = IsolatedStorageFile.GetUserStoreForApplication())
      {
          for (int i = 0; i &lt; filepaths.Count; i++)
          {
              using (var stream = new IsolatedStorageFileStream("/benchmarks/samplefiles/" + filepaths[i], FileMode.Open, store))
              {
                  using (StreamReader r = new StreamReader(stream))
                  {
                      filecontent = await r.ReadToEndAsync();
                  }
              }
          }
      }
  }
  public async Task b8LoadDataIsolatedStorageAsyncThread()
  {
      using (var store = IsolatedStorageFile.GetUserStoreForApplication())
      {
          await await Task.Factory.StartNew(async () =&gt;
          {
              for (int i = 0; i &lt; filepaths.Count; i++)
              {
                  using (var stream = new IsolatedStorageFileStream("/benchmarks/samplefiles/" + filepaths[i], FileMode.Open, store))
                  {
                      using (StreamReader r = new StreamReader(stream))
                      {
                          filecontent = await r.ReadToEndAsync();
                      }
                  }
              }
          });
      }
  }
  
  
  public async Task b9LoadDataStorageFileAsyncMy9()
  {
      StorageFolder data = await ApplicationData.Current.LocalFolder.GetFolderAsync("benchmarks");
      data = await data.GetFolderAsync("samplefiles");
  
      for (int i = 0; i &lt; filepaths.Count; i++)
      {
          StorageFile f = await data.GetFileAsync(filepaths[i]);
          using (var stream = await f.OpenStreamForReadAsync())
          {
              using (StreamReader r = new StreamReader(stream))
              {
                  filecontent = await Task.Factory.StartNew&lt;String&gt;(() =&gt; { return r.ReadToEnd(); });
              }
          }
      }
  }
  
  public async Task b10LoadDataIsolatedStorageAsyncMy10()
  {
      using (var store = IsolatedStorageFile.GetUserStoreForApplication())
      {
          //b10
          for (int i = 0; i &lt; filepaths.Count; i++)
          {
              using (var stream = new IsolatedStorageFileStream("/benchmarks/samplefiles/" + filepaths[i], FileMode.Open, store))
              {
                  using (StreamReader r = new StreamReader(stream))
                  {
                      filecontent = await Task.Factory.StartNew&lt;String&gt;(() =&gt; { return r.ReadToEnd(); });
                  }
              }
          }
      }
  }
  public async Task b11LoadDataStorageFileAsyncMy11()
  {
      StorageFolder data = await ApplicationData.Current.LocalFolder.GetFolderAsync("benchmarks");
      data = await data.GetFolderAsync("samplefiles");
  
      for (int i = 0; i &lt; filepaths.Count; i++)
      {
          await await Task.Factory.StartNew(async () =&gt;
              {
                  StorageFile f = await data.GetFileAsync(filepaths[i]);
                  using (var stream = await f.OpenStreamForReadAsync())
                  {
                      using (StreamReader r = new StreamReader(stream))
                      {
                          filecontent = r.ReadToEnd();
                      }
                  }
              });
      }
  }
  
  public async Task b12LoadDataIsolatedStorageMy12()
  {
      using (var store = IsolatedStorageFile.GetUserStoreForApplication())
      {
          for (int i = 0; i &lt; filepaths.Count; i++)
          {
              await Task.Factory.StartNew(() =&gt;
                  {
                      using (var stream = new IsolatedStorageFileStream("/benchmarks/samplefiles/" + filepaths[i], FileMode.Open, store))
                      {
                          using (StreamReader r = new StreamReader(stream))
                          {
                              filecontent = r.ReadToEnd();
                          }
                      }
                  });
          }
      }
  }
  
  public async Task b13LoadDataStorageFileParallel13()
  {
      StorageFolder data = await ApplicationData.Current.LocalFolder.GetFolderAsync("benchmarks");
      data = await data.GetFolderAsync("samplefiles");
      List&lt;Task&gt; tasks = new List&lt;Task&gt;();
      for (int i = 0; i &lt; filepaths.Count; i++)
      {
          int index = i;
          var task = await Task.Factory.StartNew(async () =&gt;
          {
              StorageFile f = await data.GetFileAsync(filepaths[index]);
              using (var stream = await f.OpenStreamForReadAsync())
              {
                  using (StreamReader r = new StreamReader(stream))
                  {
                      String content = r.ReadToEnd();
                      if (content.Length == 0)
                      {
                          //just some code to ensure this is not removed by optimization from the compiler
                          //because "content" is not used otherwise
                          //should never be called
                          ShowNotificationText(content);
                      }
                  }
              }
          });
          tasks.Add(task);
      }
      await TaskEx.WhenAll(tasks);
  }
  
  public async Task b14LoadDataIsolatedStorageParallel14()
  {
      List&lt;Task&gt; tasks = new List&lt;Task&gt;();
      using (var store = IsolatedStorageFile.GetUserStoreForApplication())
      {
          for (int i = 0; i &lt; filepaths.Count; i++)
          {
              int index = i;
              var t = Task.Factory.StartNew(() =&gt;
              {
                  using (var stream = new IsolatedStorageFileStream("/benchmarks/samplefiles/" + filepaths[index], FileMode.Open, store))
                  {
                      using (StreamReader r = new StreamReader(stream))
                      {
                          String content = r.ReadToEnd();
                          if (content.Length == 0)
                          {
                              //just some code to ensure this is not removed by optimization from the compiler
                              //because "content" is not used otherwise
                              //should never be called
                              ShowNotificationText(content);
                          }
                      }
                  }
              });
              tasks.Add(t);
          }
          await TaskEx.WhenAll(tasks);
      }
  }
  
  public async Task b15LoadDataStorageFileParallelThread15()
  {
      StorageFolder data = await ApplicationData.Current.LocalFolder.GetFolderAsync("benchmarks");
      data = await data.GetFolderAsync("samplefiles");
  
      await await Task.Factory.StartNew(async () =&gt;
          {
              List&lt;Task&gt; tasks = new List&lt;Task&gt;();
              for (int i = 0; i &lt; filepaths.Count; i++)
              {
                  int index = i;
                  var task = await Task.Factory.StartNew(async () =&gt;
                  {
                      StorageFile f = await data.GetFileAsync(filepaths[index]);
                      using (var stream = await f.OpenStreamForReadAsync())
                      {
                          using (StreamReader r = new StreamReader(stream))
                          {
                              String content = r.ReadToEnd();
                              if (content.Length == 0)
                              {
                                  //just some code to ensure this is not removed by optimization from the compiler
                                  //because "content" is not used otherwise
                                  //should never be called
                                  ShowNotificationText(content);
                              }
                          }
                      }
                  });
                  tasks.Add(task);
              }
              await TaskEx.WhenAll(tasks);
          });
  }
  
  public async Task b16LoadDataIsolatedStorageParallelThread16()
  {
      await await Task.Factory.StartNew(async () =&gt;
          {
              List&lt;Task&gt; tasks = new List&lt;Task&gt;();
              using (var store = IsolatedStorageFile.GetUserStoreForApplication())
              {
                  for (int i = 0; i &lt; filepaths.Count; i++)
                  {
                      int index = i;
                      var t = Task.Factory.StartNew(() =&gt;
                      {
                          using (var stream = new IsolatedStorageFileStream("/benchmarks/samplefiles/" + filepaths[index], FileMode.Open, store))
                          {
                              using (StreamReader r = new StreamReader(stream))
                              {
                                  String content = r.ReadToEnd();
                                  if (content.Length == 0)
                                  {
                                      //just some code to ensure this is not removed by optimization from the compiler
                                      //because "content" is not used otherwise
                                      //should never be called
                                      ShowNotificationText(content);
                                  }
                              }
                          }
                      });
                      tasks.Add(t);
                  }
                  await TaskEx.WhenAll(tasks);
              }
          });
  }
  public async Task b17LoadDataStorageFileParallel17()
  {
      StorageFolder data = await ApplicationData.Current.LocalFolder.GetFolderAsync("benchmarks");
      data = await data.GetFolderAsync("samplefiles");
      List&lt;Task&lt;Task&gt;&gt; tasks = new List&lt;Task&lt;Task&gt;&gt;();
      for (int i = 0; i &lt; filepaths.Count; i++)
      {
          int index = i;
          var task = Task.Factory.StartNew&lt;Task&gt;(async () =&gt;
          {
              StorageFile f = await data.GetFileAsync(filepaths[index]);
              using (var stream = await f.OpenStreamForReadAsync())
              {
                  using (StreamReader r = new StreamReader(stream))
                  {
                      String content = r.ReadToEnd();
                      if (content.Length == 0)
                      {
                          //just some code to ensure this is not removed by optimization from the compiler
                          //because "content" is not used otherwise
                          //should never be called
                          ShowNotificationText(content);
                      }
                  }
              }
          });
          tasks.Add(task);
      }
      await TaskEx.WhenAll(tasks);
      List&lt;Task&gt; tasks2 = new List&lt;Task&gt;();
      foreach (var item in tasks)
      {
          tasks2.Add(item.Result);
      }
      await TaskEx.WhenAll(tasks2);
  }
  
  public async Task b18LoadDataStorageFileParallelThread18()
  {
      StorageFolder data = await ApplicationData.Current.LocalFolder.GetFolderAsync("benchmarks");
      data = await data.GetFolderAsync("samplefiles");
  
      await await Task.Factory.StartNew(async () =&gt;
      {
          List&lt;Task&lt;Task&gt;&gt; tasks = new List&lt;Task&lt;Task&gt;&gt;();
          for (int i = 0; i &lt; filepaths.Count; i++)
          {
              int index = i;
              var task = Task.Factory.StartNew&lt;Task&gt;(async () =&gt;
              {
                  StorageFile f = await data.GetFileAsync(filepaths[index]);
                  using (var stream = await f.OpenStreamForReadAsync())
                  {
                      using (StreamReader r = new StreamReader(stream))
                      {
                          String content = r.ReadToEnd();
                          if (content.Length == 0)
                          {
                              //just some code to ensure this is not removed by optimization from the compiler
                              //because "content" is not used otherwise
                              //should never be called
                              ShowNotificationText(content);
                          }
                      }
                  }
              });
              tasks.Add(task);
          }
          await TaskEx.WhenAll(tasks);
          List&lt;Task&gt; tasks2 = new List&lt;Task&gt;();
          foreach (var item in tasks)
          {
              tasks2.Add(item.Result);
          }
          await TaskEx.WhenAll(tasks2);
      });
  }
  public async Task b19LoadDataIsolatedStorageAsyncMyThread()
  {
      using (var store = IsolatedStorageFile.GetUserStoreForApplication())
      {
          //b19
          await await Task.Factory.StartNew(async () =&gt;
          {
              for (int i = 0; i &lt; filepaths.Count; i++)
              {
                  using (var stream = new IsolatedStorageFileStream("/benchmarks/samplefiles/" + filepaths[i], FileMode.Open, store))
                  {
                      using (StreamReader r = new StreamReader(stream))
                      {
                          filecontent = await Task.Factory.StartNew&lt;String&gt;(() =&gt; { return r.ReadToEnd(); });
                      }
                  }
              }
          });
      }
  }
  
  public async Task b20LoadDataIsolatedStorageAsyncMyConfigure()
  {
      using (var store = IsolatedStorageFile.GetUserStoreForApplication())
      {
          for (int i = 0; i &lt; filepaths.Count; i++)
          {
              using (var stream = new IsolatedStorageFileStream("/benchmarks/samplefiles/" + filepaths[i], FileMode.Open, store))
              {
                  using (StreamReader r = new StreamReader(stream))
                  {
                      filecontent = await Task.Factory.StartNew&lt;String&gt;(() =&gt; { return r.ReadToEnd(); }).ConfigureAwait(false);
                  }
              }
          }
      }
  }
  public async Task b21LoadDataIsolatedStorageAsyncMyThreadConfigure()
  {
      using (var store = IsolatedStorageFile.GetUserStoreForApplication())
      {
          await await Task.Factory.StartNew(async () =&gt;
          {
              for (int i = 0; i &lt; filepaths.Count; i++)
              {
                  using (var stream = new IsolatedStorageFileStream("/benchmarks/samplefiles/" + filepaths[i], FileMode.Open, store))
                  {
                      using (StreamReader r = new StreamReader(stream))
                      {
                          filecontent = await Task.Factory.StartNew&lt;String&gt;(() =&gt; { return r.ReadToEnd(); }).ConfigureAwait(false);
                      }
                  }
              }
          });
      }
  }
  public async Task b22LoadDataOwnReadFileMethod()
  {
      await await Task.Factory.StartNew(async () =&gt;
      {
          for (int i = 0; i &lt; filepaths.Count; i++)
          {
              filecontent = await ReadFile("/benchmarks/samplefiles/" + filepaths[i]);
  
          }
      });
  
  }
  public async Task b23LoadDataOwnReadFileMethodParallel()
  {
      List&lt;Task&gt; tasks = new List&lt;Task&gt;();
  
      for (int i = 0; i &lt; filepaths.Count; i++)
      {
          int index = i;
          var t = ReadFile("/benchmarks/samplefiles/" + filepaths[i]);
          tasks.Add(t);
      }
      await TaskEx.WhenAll(tasks);
  
  }
  public async Task b24LoadDataOwnReadFileMethodParallelThread()
  {
      await await Task.Factory.StartNew(async () =&gt;
          {
              List&lt;Task&gt; tasks = new List&lt;Task&gt;();
  
              for (int i = 0; i &lt; filepaths.Count; i++)
              {
                  int index = i;
                  var t = ReadFile("/benchmarks/samplefiles/" + filepaths[i]);
                  tasks.Add(t);
              }
              await TaskEx.WhenAll(tasks);
  
          });
  }
  
  
  public async Task b25LoadDataOwnReadFileMethodStorageFile()
  {
      StorageFolder data = await ApplicationData.Current.LocalFolder.GetFolderAsync("benchmarks");
      data = await data.GetFolderAsync("samplefiles");
      await await Task.Factory.StartNew(async () =&gt;
      {
          for (int i = 0; i &lt; filepaths.Count; i++)
          {
              filecontent = await ReadStorageFile(data, filepaths[i]);
  
          }
      });
  
  }
  public async Task b26LoadDataOwnReadFileMethodParallelStorageFile()
  {
      StorageFolder data = await ApplicationData.Current.LocalFolder.GetFolderAsync("benchmarks");
      data = await data.GetFolderAsync("samplefiles");
      List&lt;Task&gt; tasks = new List&lt;Task&gt;();
  
      for (int i = 0; i &lt; filepaths.Count; i++)
      {
          int index = i;
          var t = ReadStorageFile(data, filepaths[i]);
          tasks.Add(t);
      }
      await TaskEx.WhenAll(tasks);
  
  }
  public async Task b27LoadDataOwnReadFileMethodParallelThreadStorageFile()
  {
      StorageFolder data = await ApplicationData.Current.LocalFolder.GetFolderAsync("benchmarks");
      data = await data.GetFolderAsync("samplefiles");
      await await Task.Factory.StartNew(async () =&gt;
      {
          List&lt;Task&gt; tasks = new List&lt;Task&gt;();
  
          for (int i = 0; i &lt; filepaths.Count; i++)
          {
              int index = i;
              var t = ReadStorageFile(data, filepaths[i]);
              tasks.Add(t);
          }
          await TaskEx.WhenAll(tasks);
  
      });
  }
  
  public async Task b28LoadDataOwnReadFileMethodStorageFile()
  {
      //StorageFolder data = await ApplicationData.Current.LocalFolder.GetFolderAsync("benchmarks");
      //data = await data.GetFolderAsync("samplefiles");
      await await Task.Factory.StartNew(async () =&gt;
      {
          for (int i = 0; i &lt; filepaths.Count; i++)
          {
              filecontent = await ReadStorageFile(ApplicationData.Current.LocalFolder, @"benchmarks\samplefiles\" + filepaths[i]);
  
          }
      });
  
  }
  
  public async Task&lt;String&gt; ReadStorageFile(StorageFolder folder, String filename)
  {
      return await await Task.Factory.StartNew&lt;Task&lt;String&gt;&gt;(async () =&gt;
      {
          String filec = "";
          StorageFile f = await folder.GetFileAsync(filename);
          using (var stream = await f.OpenStreamForReadAsync())
          {
              using (StreamReader r = new StreamReader(stream))
              {
                  filec = await r.ReadToEndAsyncThread();
              }
          }
          return filec;
      });
  }
  
  public async Task&lt;String&gt; ReadFile(String filepath)
  {
      return await await Task.Factory.StartNew&lt;Task&lt;String&gt;&gt;(async () =&gt;
          {
              String filec = "";
              using (var store = IsolatedStorageFile.GetUserStoreForApplication())
              {
                  using (var stream = new IsolatedStorageFileStream(filepath, FileMode.Open, store))
                  {
                      using (StreamReader r = new StreamReader(stream))
                      {
                          filec = await r.ReadToEndAsyncThread();
                      }
                  }
              }
              return filec;
          });
  }
  </code></pre>
  
  <p>How these benchmarks are run:</p>
  
  <pre><code>public async Task RunBenchmark(String message, Func&lt;Task&gt; benchmarkmethod)
      {
          SystemTray.ProgressIndicator.IsVisible = true;
          SystemTray.ProgressIndicator.Text = message;
          SystemTray.ProgressIndicator.Value = 0;
          long milliseconds = 0;
  
          Stopwatch w = new Stopwatch();
          List&lt;long&gt; results = new List&lt;long&gt;(benchmarkruns);
          for (int i = 0; i &lt; benchmarkruns; i++)
          {
              w.Reset();
              w.Start();
              await benchmarkmethod();
              w.Stop();
              milliseconds += w.ElapsedMilliseconds;
              results.Add(w.ElapsedMilliseconds);
              SystemTray.ProgressIndicator.Value += (double)1 / (double)benchmarkruns;
          }
  
          Log.Write("Fastest: " + results.Min(), "Slowest: " + results.Max(), "Average: " + results.Average(), "Median: " + results[results.Count / 2], "Maxdifference: " + (results.Max() - results.Min()),
                    "All results: " + results);
  
  
          ShowNotificationText((message + ":").PadRight(24) + (milliseconds / ((double)benchmarkruns)).ToString());
          SystemTray.ProgressIndicator.IsVisible = false;
      }
  </code></pre>
  
  <h1>Benchmark results</h1>
  
  <p>Here a link to the raw benchmark data: <a href="http://www.dehodev.com/windowsphonebenchmarks.xlsx" rel="nofollow noreferrer">http://www.dehodev.com/windowsphonebenchmarks.xlsx</a></p>
  
  <p>Now the graphs (every graph shows the data for loading 50 via each method, results are all in milliseconds)</p>
  
  <p><img src="https://i.stack.imgur.com/BNTV9.png" alt="1kb file size benchmarks"></p>
  
  <p>The next benchmarks with 1mb are not really representative for apps. I include them here to give a better overview on how these methods scale.</p>
  
  <p><img src="https://i.stack.imgur.com/F8ndq.png" alt="enter image description here"></p>
  
  <p>So to sum it all up: The standard method used to read files (1.) is always the worst (except in the case you want to read 50 10mb files, but even then there are better methods).</p>
  
  <hr>
  
  <p>I'm also linking this: <a href="https://stackoverflow.com/questions/11531934/await-asyncmethod-versus-await-await-task-factory-startnewtresultasyncmetho">await AsyncMethod() versus await await Task.Factory.StartNew&lt;TResult&gt;(AsyncMethod)</a>, where it is argued that normally it is not useful to add a new task. However the results I'm seeing here are that you just can't asume that and should always check if adding a task improves performance.</p>
  
  <p>And last: I wanted to post this in the official Windows Phone developer forum but everytime I try, I get an "Unexpected Error" message...</p>
  
  <h1>Update 2</h1>
  
  <h2>Conclusions:</h2>
  
  <p>After reviewing the data you can clearly see that no matter the file size every algorithm scales linear to the number of files. So to simplify everything we can ignore the number of files (we will just use the data for 50 files in future comparisons).</p>
  
  <p>Now on to file size: File size is important. We can see that when we increase the file size the algorithms begin to converge. At 10MB file size the previous slowest algorithm takes place 4 of 8. However because this question primarily deals with phones it’s incredibly rare that apps will read multiple files with this much data, even 1MB files will be rare for most apps. My guess is, that even reading 50 20kb files is uncommon. Most apps are probably reading data in the range of 10 to 30 files, each the size of 0.5kb to 3kb. (This is only a guess, but I think it might be accurate)</p>