Assault by GC(marcgravell.blogspot.com)

submitted by NoldorinNoldorin(829) 6 months, 28 days ago

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.

2 comments |category: |Views: 30

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

posted by dpetersondpeterson(4397) 6 months, 28 days ago 0

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.

Reply

posted by NoldorinNoldorin(829) replied to dpetersondpeterson(4397), 6 months, 27 days ago 0

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.

Reply

information Login or create an account to comment on this story