IL Performance Optimization
Recently, an old co-worker contacted me to ask me a question about code performance. Specifically, he was emitting IL from his code and had some questions about some of the opcode usage he witnessed when viewing the IL of some compiled assemblies. The question was based on a simple application he wrote in C#, compiled, and disassembled. He did this to see how the C# compiler produced IL and give him clues in how he should emit IL. The function in question was as follows:
public object GetProp(string name)
{ if (name == "X")
{ return this.X;
}
return null;
}
(
continue)