title: Performance degradation after upgrading to Microsoft.Azure.Cosmos.Table to access Azure table storage
body: <p>We upgraded to the next version of SDK to access our Azure Table storage.</p>
  
  <p>We observed performance degradation of our application after that. We even created test applications with identical usage pattern to isolate it, and still see this performance hit.</p>
  
  <p>We are using .NET Framework code, reading data from Azure table.</p>
  
  <p>Old client: Microsoft.WindowsAzure.Storage - 9.3.2</p>
  
  <p>New client: Microsoft.Azure.Cosmos.Table - 1.0.6</p>
  
  <p>Here is one of the sample tests we tried to run:</p>
  
  <pre><code>public async Task ComparisionTest1()
  {
      var partitionKey = CompanyId.ToString();
  
      {
          // Microsoft.Azure.Cosmos.Table
          var storageAccount = Microsoft.Azure.Cosmos.Table.CloudStorageAccount.Parse(ConnectionString);
          var tableClient = Microsoft.Azure.Cosmos.Table.CloudStorageAccountExtensions.CreateCloudTableClient(storageAccount);
          var tableRef = tableClient.GetTableReference("UserStatuses");
          var query = new Microsoft.Azure.Cosmos.Table.TableQuery&lt;Microsoft.Azure.Cosmos.Table.TableEntity&gt;()
                              .Where(Microsoft.Azure.Cosmos.Table.TableQuery.GenerateFilterCondition("PartitionKey", "eq", partitionKey));
          var result = new List&lt;Microsoft.Azure.Cosmos.Table.TableEntity&gt;(20000);
  
          var stopwatch = Stopwatch.StartNew();
          var tableQuerySegment = await tableRef.ExecuteQuerySegmentedAsync(query, null);
          result.AddRange(tableQuerySegment.Results);
          while (tableQuerySegment.ContinuationToken != null)
          {
              tableQuerySegment = await tableRef.ExecuteQuerySegmentedAsync(query, tableQuerySegment.ContinuationToken);
              result.AddRange(tableQuerySegment.Results);
          }
  
          stopwatch.Stop();
          Trace.WriteLine($"Cosmos table client. Elapsed: {stopwatch.Elapsed}");
      }
  
      {
          // Microsoft.WindowsAzure.Storage
          var storageAccount = Microsoft.WindowsAzure.Storage.CloudStorageAccount.Parse(ConnectionString);
          var tableClient = storageAccount.CreateCloudTableClient();
          var tableRef = tableClient.GetTableReference("UserStatuses");
          var query = new Microsoft.WindowsAzure.Storage.Table.TableQuery&lt;Microsoft.WindowsAzure.Storage.Table.TableEntity&gt;()
                              .Where(Microsoft.WindowsAzure.Storage.Table.TableQuery.GenerateFilterCondition("PartitionKey", "eq", partitionKey));
          var result = new List&lt;Microsoft.WindowsAzure.Storage.Table.TableEntity&gt;(20000);
  
          var stopwatch = Stopwatch.StartNew();
          var tableQuerySegment = await tableRef.ExecuteQuerySegmentedAsync(query, null);
          result.AddRange(tableQuerySegment.Results);
          while (tableQuerySegment.ContinuationToken != null)
          {
              tableQuerySegment = await tableRef.ExecuteQuerySegmentedAsync(query, tableQuerySegment.ContinuationToken);
              result.AddRange(tableQuerySegment.Results);
          }
  
          stopwatch.Stop();
          Trace.WriteLine($"Old table client. Elapsed: {stopwatch.Elapsed}");
      }
  }
  </code></pre>
  
  <p>Anyone observed it, any thoughts about it?</p>