Friday April 29th

Thursday April 28th

Wednesday April 27th

Assault by GC

Well-known .NET developer Marc Gravell details how he eliminated some performance problems through clever use of structures, and explains how the CLR garbage collector behaves.


I've also swapped out classes for structs and lists for arrays before and noticed a significant performance improvement in the code I was working with (tight loop, lot's of data processing).
I feel this is a good example for avoiding premature optimization: They went the correct route here and wrote good, clean, object-oriented code up-front; When they discovered a bottle-neck their good practices allowed them to segregate that section of code, perform the optimizations they listed, all without effecting any of the other code.

I agree... Well all know premature micro-optimisation is a bad thing, and really micro-optimisation of *any sort* in a high-level language like C# should be well-commented. Most of the time one either doesn't care about the performance benefits, or they're simply negligible given the effort required to make them/reduction in readability of code. Even when I do have to micro-optimise, I personally try to abstract the nasty stuff away into a separate module, if possible.

Commenting on Stories is limited for now and will open up to those recommended by the community. Learn how
Loading DotNetKicks...
brought to you by the Kicks Network