How smart is the C# compiler, given the following:
float a = 1; //A
var b = 1f; //B
var c = (float)1; //C - Is this line equivalent to A and B?
var d = Convert.ToSingle(1); //D - Is this line equivalent to A and B?
As far as I know, A and B are equivalent after the compilation. What about the other lines?
Are C and D optimized in compile-time to be equivalent to A and B or are they going to be assigned only in run-time, causing more processing to perform the assignment?
I suppose casting (C) must be optimized and the function (D) must not.
In any case, how could I investigate and compare the generated assembly code using VS2012?