开发者

Any performance improvements using PLinq in DomainService query operations

Can i expect any performance improvements if i use the .AsParallel() extension in the query operations of my domain service. The DomainService uses a Repository (EntityFramework) to query data and to build up ViewModels for the client that are returned by the query operations.

Here´s a simple query operation in my DomainService:

[Query]
public IQueryable<ProductViewModel> GetProductSet() {
  var products = from product in _productRepository.Query()
                 select product;

  return (from product in products.ToList() 
          select new ProductViewModel() { Product = product}).AsQueryable();
}

If i can speed up things using PLinq, where should i add the .AsParallel() call?

Here

_productRepository.Query().AsParallel();

There

products.AsPa开发者_StackOverflow中文版rallel().ToList()

or there

product.ToList().AsParallel()
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜