I do not see any improvements in processing speed using the following code:
IEnumerable<Quote> sortedQuotes = (from x in unsortedQuotes.AsParallel()
orderby (x.DateTimeTicks)
select x);
over the sequential version:
IEnumerable<Quote> sortedQuotes = (from x in unsortedQuotes
orderby (x.DateTimeTicks)
select x);
Am I missing something here? I varied the number of items in the source collections from thousands to several tens of millions and no size showed the Parallel version coming out ahead.
Any tips appreciated. By the way if anyone knows of a faster way to sort more efficiently (given my indicated item variable type (containing a long DateTimeTicks by which the items are sorted in the collection) that would also be appreciate.
Edit: “sorting efficiently” -> As fast as possible.
Thanks
According to this page,
Your query only contains a Sort, the select doesn’t count. So the PLINQ engine will execute it as sequential.
You can only expect some improvement when the sorting is a part of a larger query.