WCF Data Services vs WAQS – Performance aspect

The main reason why I made WAQS was the query limitations with WCF Data Services and WCF RIA Services.

WAQS changed a lot from June and it has a lot of features in addition of querying from the client on 3 tiers applications.

BTW, ping me if you want to learn more about it.

In previous days, I optimized WAQS. So I wanted to test it vs WCF Data Services to see if WAQS features gain does not have a bad impact on performances.

So I test several simples queries on Contoso database which has more data than Northwind.

Note that, in my test, I use default configuration of WAQS and of WCF Data Services.

 

This is the result for WCF Data Services:

  • Get 18,869 customers: 6,693 ms
    var query = _context.DimCustomers;
    var customers = (await Task.Factory.FromAsync(query.BeginExecute(null, null),
        ar => query.EndExecute(ar))).ToList();
  • Get customers CompanyName: 2,652 ms
    var query = (DataServiceQuery<DimCustomer>)_context.DimCustomers
        .Select(c => new DimCustomer { CustomerKey = c.CustomerKey, CompanyName = c.CompanyName });
    var customers = (await Task.Factory.FromAsync(query.BeginExecute(null, null),
        ar => query.EndExecute(ar)))
        .Select(c => c.CompanyName).ToList();
  • Get 100 customers with their online sales: 9,672 ms
    var query = (DataServiceQuery<DimCustomer>)_context.DimCustomers
        .Expand("FactOnlineSales")
        .Take(100);
    var customers = (await Task.Factory.FromAsync(query.BeginExecute(null, null),
        ar => query.EndExecute(ar))).ToList();
  • Get 100 customers with their online sales with products of this ones: 27,021 ms
    var query = (DataServiceQuery<DimCustomer>)_context.DimCustomers
        .Expand("FactOnlineSales/DimProduct")
        .Take(100);
    var customers = (await Task.Factory.FromAsync(query.BeginExecute(null, null),
        ar => query.EndExecute(ar))).ToList();
  • Get 100 customers with their online sales with products and categories of this ones: 42,604 ms
    var query = (DataServiceQuery<DimCustomer>)_context.DimCustomers
        .Expand("FactOnlineSales/DimProduct/DimProductSubcategory/DimProductCategory")
        .Take(100);
    var customers = (await Task.Factory.FromAsync(query.BeginExecute(null, null),
        ar => query.EndExecute(ar))).ToList();
  • Get 200 customers with their online sales with products and categories of this ones: Exception !
    var query = (DataServiceQuery<DimCustomer>)_context.DimCustomers
        .Expand("FactOnlineSales/DimProduct/DimProductSubcategory/DimProductCategory")
        .Take(200);
    var customers = (await Task.Factory.FromAsync(query.BeginExecute(null, null),
        ar => query.EndExecute(ar))).ToList();


Now, the same with WAQS:



  • Get 18,869 customers: 3,307 ms (instead of 6,693 ms)
    var customers = (await _context.DimCustomers.AsAsyncQueryable().Execute()).ToList();
  • Get customers CompanyName: 187 ms (instead of 2,652 ms)
    var customers = (await _context.DimCustomers.AsAsyncQueryable()
        .Select(c => c.CompanyName)
        .Execute()).ToList();
  • Get 100 customers with their online sales: 3,260 ms (au lieu de 9,672 ms)
    var customers = (await _context.DimCustomers.AsAsyncQueryable()
        .OrderBy(c => c.CustomerKey)
        .Take(100)
        .IncludeFactOnlineSales()
        .Execute()).ToList();
  • Get 100 customers with their online sales with products of this ones: 4,336 ms (instead of 27,021 ms)

    The code is blocked by msmvps. It’s available on my French blog http://blogs.codes-sources.com/matthieu/archive/2013/02/11/wcf-data-services-vs-waqs.aspx. Sorry for that.
     
  • Get 100 customers with their online sales with products and categories of this ones: 4,883 ms (instead of 42,604 ms)

    The code is blocked by msmvps. It’s available on my French blog http://blogs.codes-sources.com/matthieu/archive/2013/02/11/wcf-data-services-vs-waqs.aspx. Sorry for that.
     
  • Get 200 customers with their online sales with products and categories of this ones: 7,029 ms (instead of exception)

    The code is blocked by msmvps. It’s available on my French blog http://blogs.codes-sources.com/matthieu/archive/2013/02/11/wcf-data-services-vs-waqs.aspx. Sorry for that.
     



If we do not take in consideration the infinite rate of the last query, WAQS is between 2.02 and 14.18 faster than WCF Data Services with an average of 6,83 in my tests.



That’s a load off my mind! :)



// Note that the current version of WAQS is not public yet

This entry was posted in 16868, 17697. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>