Visual C++ 9个编译选项让程序运行更快

发布于 2024-08-25 03:00:32 字数 119 浏览 5 评论 0原文

我从源代码构建了一个开源应用程序。不幸的是,原始可执行文件的运行速度明显更快。我尝试启用一些编译器优化,但结果不够令人满意。我还需要在 Visual Studio 2008 中做什么来提高可执行性能?

谢谢!

I have built an open-source application from the source code. Unfortunately, the original executable runs significantly faster. I tried to enable few compiler optimizations, but the result wasn't satisfactory enough. What else do I need to make in Visual Studio 2008 to increase the executable performance?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

紫瑟鸿黎 2024-09-01 03:00:32

基本上尝试在项目设置中启用“优化”下的所有内容,然后确保打开“链接时间代码生成”,启用功能级链接和完整 COMDAT 折叠(这只会减小 EXE 的大小,但有助于缓存),并关闭诸如此类的安全功能通过定义 _SECURE_SCL=0 即可。请记住,其中一些设置还有其他含义,尤其是安全方面的含义。

Basically try enabling everything under Optimisation in project settings, then ensure Link Time Code Generation is on, enable Function-level linking and full COMDAT folding (that only reduces the size of the EXE but could help with caching), and turn off security features such as by defining _SECURE_SCL=0. Remember some of these settings have other implications, especially the security ones.

迷雾森÷林ヴ 2024-09-01 03:00:32

编译时尝试启用SSE指令。另外 - 您可以尝试使用不同的编译器(GNU GCC)进行编译。
+可能启用了一些调试定义,这也会降低速度。
+检查,原始 .exe 的版本与您尝试编译的版本相同。

Try to enable SSE instructions, when compiling. Also - you can try to compile using different compiler (GNU GCC).
+There might be enabled some debug defines, shich also can reduce speed.
+Check, that original .exe has same version as one you are trying to compile.

征﹌骨岁月お 2024-09-01 03:00:32

开源预编译二进制文件很可能(不知道您正在使用哪个项目)使用 GNU GCC(Windows 上的 Mingw)编译。这可能是它更快的原因。根据问题:性能g++与VC++有些事情是如果使用 VC++,速度会慢得多。

The open-source precompiled binary is most likely (whit out know which project you are working with) compiled with GNU GCC (Mingw on Windows). That might be the reason that it is faster. According to question: performance g++ vs. VC++ some things are considerably slower if you use VC++.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文