3 ms·
The mono C# compiler should pre-evaluate the loop and just set x to the computed value. You'd have to look at the bytecode to verify, but i would be shocked if
by aaronblohowiak 15y ago
The mono C# compiler should pre-evaluate the loop and just set x to the computed value. You'd have to look at the bytecode to verify, but i would be shocked if mono didn't do that.
Still, it should take the blink of an eye, not a chin-scratch.
- ssmoot 15y agoI get that it could, is there a reason you think it actually does? Either way, nice observation. Interesting.
- deleted 15y ago[deleted]
- aaronblohowiak 15y agoI have no first-hand evidence of the behavior of mono, but constant expression elimination is a common compiler optimization.