Nipun Tomar
What optimizations does the C# compiler perform when you use the /optimize+ compiler option?
By Nipun Tomar in C# on Jul 12 2006
  • Nipun Tomar
    Jul, 2006 12

    The following is a response from a developer on the C# compiler team: We get rid of unused locals (i.e., locals that are never read, even if assigned). We get rid of unreachable code. We get rid of try-catch with an empty try. We get rid of try-finally with an empty try. We get rid of try-finally with an empty finally. We optimize branches over branches: gotoif A, lab1 goto lab2: lab1: turns into: gotoif !A, lab2 lab1: We optimize branches to ret, branches to next instruction, and branches to branches.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS