Insights on Linq Count() vs Count Property

In this post I am investigating the difference between Count property and Count() extension method of the .NET enumerable. Below code snippet sets the scene of what we trying to answer.

As in the previous post will start by decompiling the System.Core 4.0.0.0 dll.

The Linq Count() extension method behaves differently based on the…

Insights on Linq Any() Performance

The Enumerable.Any<TSource>() is an extension method that lives in System.Core assembly under System.Linq namespace. If you are wondering what happens with the extended enumerable source then this is the right post. In the right gets enumerated or not then we would have to look at the implementation. In System.Core 4.0.0.0 the Any(…) method comes with two overloads which is worth investigating. Simply…

Insights on .NET Concurrency: Asynchronous Programming

Intro In this post of the concurrency series we will provide insights on asynchronous programming. So what is asynchrony? Succinctly, is about not blocking the thread that initiates an operation. The key difference between synchronous and asynchronous is that the latter can start a new operation before the first one completes. For example, a user clicks on a button to fetch…

The Janus Task Class

Intro The msdn API reference defines the Task class as a representation of an asynchronous operation. However, as soon as you start writing Task based code for asynchronous/parallel programming, or simply offloading work to a thread pool thread, it becomes obvious that Task has more than one face based on the use case.

Task Faces Active…

Insights on .NET Concurrency: Parallel Programming

Intro Parallel programming is the next post from the Insights on .NET Concurrency series. Parallelism is about making more than one thing happen at the same time, with the main objective being improve the performance of CPU bound operations. Parallel programming model tries to overcome single core limitations. With parallelism we can process larger more complex problems in a more…