Benefits of 'Optimize code' option in Visual Studio build

后端 未结 5 779
情歌与酒
情歌与酒 2020-12-24 06:29

Much of our C# release code is built with the \'Optimize code\' option turned off. I believe this is to allow code built in Release mode to be debugged more easily.

5条回答
  •  醉酒成梦
    2020-12-24 06:52

    I find that with complex, CPU intensive code (the code i'm using is a Monte Carlo simulation that can spawn enough threads to 100% utilize a computer. This was tested in a 36 core environment) the performance hit can be up to 4 times higher! A simulation that takes 2 hours will take about 9 hours without the optimization flag. (the paths are about 500,000 and for each paths there are 500 steps for around 2000 different objects with highly complex calculation on each objects).

提交回复
热议问题