Visual Studio 2008 awful performance

不问归期 提交于 2019-12-23 03:14:08

问题


I have ported a piece of C++ code, that works out of core, from Linux(Ubuntu) to Windows(Vista) and I realized that it works about 50times slower on VS2008! I removed all the out of core parts and now I just have a piece of code that has nothing to do with the hard disk.

I set compiler parameters to O2 in Project Properties but still get about 10times slower than g++ in linux!

Does anybody have an idea why it is this much slower under VS?

I really appreciate any kind of hint!

Thanks,


回答1:


Do you use a lot of the standard C++ library? If so, you might want to turn off the "checked iterators" feature that is on by default in Visual C++ (even in Release mode). Put this before including any standard headers:

#define _SECURE_SCL 0

More info here.




回答2:


No need to guess. Just hit the "pause" button and look at the stack. The chance that you will miss the problem is 1/50. If you're not sure, do it several times.



来源:https://stackoverflow.com/questions/2831039/visual-studio-2008-awful-performance

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