Array Bounds Check Elimination in the CLR?

断了今生、忘了曾经 提交于 2019-11-28 10:23:26

Thanks to a comment by Cody Gray, I've managed to answer my own question:

By default, JIT Optimizations are disabled when debugging. To fix this, one can go to Debug -> Options and Settings -> Debugging -> General, and uncheck both "Enable Just My Code" and "Suppress JIT Optimization on module load".

Also see http://msdn.microsoft.com/en-us/library/ms241594.aspx

With optimization enabled, the bounds check are removed as advertised.

I'll leave this here for documentation purposes.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!