Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy new Azure Storage Client Library 2.0 has poor query performance compare to legacy TableServiceQuery?
    primarykey
    data
    text
    <p>I just do the proof of concept to measure performance improvement for new Azure Storage Client Library 2.0 and its legacy TableServiceQuery.</p> <p>After run the result, I'm surprise! Instead of Azure SCL 2.0 will have performance gain. Its performance is poor by double compare to TableServiceQuery.</p> <p>Here is my code:</p> <pre><code>var account = CloudStorageAccount.Parse(ConfigHelper.DataConnectionString); var tableClient = account.CreateCloudTableClient(); var context = tableClient.GetTableServiceContext(); var table = tableClient.GetTableReference("User"); var sw = new Stopwatch(); sw.Start(); for (int i = 0; i &lt; 100; i++) { var query = context.CreateQuery&lt;User&gt;("User"); var temp = (from item in query where item.PartitionKey == "12345" select item).First(); temp.ToString(); } sw.Stop(); Console.WriteLine("TableServiceQuery: " + sw.Elapsed); sw.Reset(); sw.Start(); for (int i = 0; i &lt; 100; i++) { var query = new TableQuery&lt;User&gt;().Where(TableQuery.GenerateFilterCondition("PartitionKey", QueryComparisons.Equal, "12345")).Take(1); var temp = table.ExecuteQuerySegmented(query, null).First(); temp.ToString(); } sw.Stop(); Console.WriteLine("TableQuery: " + sw.Elapsed); </code></pre> <p>And result is</p> <pre><code>TableServiceQuery: 00:00:13.8179295 TableQuery: 00:00:34.8782858 </code></pre> <p>I tried several times but new SCL 2.0 (TableQuery) always spent time more than double. The table 'User' which I query have records around million records.</p> <p>My understand is new API should have major performance improvement. Anybody please explain did I am missing something in my code? Or what should I do to make new library has better performance?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload