Probably one of the most important things that I took away from the CLR Performance training we had this past week is that you really need to get an understanding of what things are doing under the hood - know what things cost. Don’t get me wrong, writing managed code is a wonderful thing; it makes writing powerful applications incredibly easy and is a real productivity boost to developers. As it was simply put (stolen from Spiderman): With great power comes great responsibility.

On a quick whim, I decided to quickly throw one of my favorite applications, SharpReader, under the knife of the CLR Profiler to see why it a) takes up so much memory and b) why it takes forever to load. Note: I have 90 RSS Feeds. My box is a 2.5ghz, 512MB RAM system. I shouldn’t be running slowly.

I also should clarify that I’m not an expert by any means using the Profiler, but here are some interesting discoveries:

Lots of strings - Almost 58MB of them.

Lots of objects surviving garbage collection in Generation 2.

XML Serialization is expensive. Very expensive.

I’m not trying to pick on SharpReader - I love this application. It’s just a prime example of looking under the hood to really find out how much things cost.



No Comments

No comments yet.

Sorry, the comment form is closed at this time.