Background: I’m developing for the xbox and am at the optomising stage. I need to cut down on object allocations. One place to start is finding out where (un)boxing occurs.
I’m very new to IL (in that i’ve never looked at any!) and would like to avoid running DLLs through a dissassembler, hunting for the (un)box command then trying to work out what line of code it relates to.
Question: Are there any tools which will report this kind of thing (where (un)boxing occurs) for me?
EDIT: Made request below into its own question since it’s fairly distinct from this one.
Many, many, bonus points for a way of tieing a GC heap dump back to lines of code where the object creations occured!!
This MSDN Magazine article details how to create an FxCop (Code Analysis) rule that detects boxing and unboxing and can present violations as a warning. The article is a little on the old side, but you should be able to adapt it to your needs.