Visual Studio 2008性能糟糕 [英] Visual Studio 2008 awful performance

查看:174
本文介绍了Visual Studio 2008性能糟糕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经移植了一个C ++代码,从核心,从Linux(Ubuntu)到Windows(Vista),我意识到,它的工作速度比VS2008慢50倍!我删除了所有的核心部分,现在我只是有一块代码与硬盘无关。



我设置编译器参数为O2在项目属性,但仍然比g ++在linux上慢了大约10倍!



有没有人知道为什么VS在VS下这么慢?


$



感谢,

解决方案

你使用很多标准的C ++库吗?如果是这样,您可能想关闭默认情况下在Visual C ++中启用的checked iterators功能(即使在发布模式下)。在包含任何标准标头之前加入此标签:

  #define _SECURE_SCL 0 

更多信息


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,

解决方案

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.

这篇关于Visual Studio 2008性能糟糕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆