Monday, March 09, 2009

LINQ Benchmark fixed.
I posted about the benchmark in the Creators Club forums and they explained me why these results were incorrect. I measured it wrong.
The thing is that on the LINQ test I wasn't actually running the query. To run it, I must at least iterate over the result, this is because the defered execution of the IEnumerable implementation, and the return yield it runs.

So I rewrote it, and the results came out more predictable, here you have them.

I also increased the valueCount to a hundred million values. And there you have it, even though LINQ version is more elegant, it took almost twice the time, so for time critical operation I would prefer avoiding it.