I have recently noticed some odd behavior in the CLR optimizer. In particular, certain simple methods were getting optimized out in release builds sometimes. I can run the same program (no user/external input) 10 times in a row and 3 times it will inline one of the methods and 7 times it won't.
So, my question is, does the CLR have optimizations that it applies based on external variables such as current CPU/memory load or DateTime.Now.TotalMilliseconds % 3
? Now that I know about the "sometimes" optimizations I can work around it as necessary, but I am curious why I might see different behavior on successive runs of the same program.