• <i id='GpilM'><tr id='GpilM'><dt id='GpilM'><q id='GpilM'><span id='GpilM'><b id='GpilM'><form id='GpilM'><ins id='GpilM'></ins><ul id='GpilM'></ul><sub id='GpilM'></sub></form><legend id='GpilM'></legend><bdo id='GpilM'><pre id='GpilM'><center id='GpilM'></center></pre></bdo></b><th id='GpilM'></th></span></q></dt></tr></i><div id='GpilM'><tfoot id='GpilM'></tfoot><dl id='GpilM'><fieldset id='GpilM'></fieldset></dl></div>
      <bdo id='GpilM'></bdo><ul id='GpilM'></ul>

    <small id='GpilM'></small><noframes id='GpilM'>

  • <legend id='GpilM'><style id='GpilM'><dir id='GpilM'><q id='GpilM'></q></dir></style></legend>

    1. <tfoot id='GpilM'></tfoot>

      1. 是否有理由不使用链接时优化 (LTO)?

        Is there a reason why not to use link-time optimization (LTO)?(是否有理由不使用链接时优化 (LTO)?)
      2. <legend id='24WIZ'><style id='24WIZ'><dir id='24WIZ'><q id='24WIZ'></q></dir></style></legend>
          <tbody id='24WIZ'></tbody>

        <small id='24WIZ'></small><noframes id='24WIZ'>

        <i id='24WIZ'><tr id='24WIZ'><dt id='24WIZ'><q id='24WIZ'><span id='24WIZ'><b id='24WIZ'><form id='24WIZ'><ins id='24WIZ'></ins><ul id='24WIZ'></ul><sub id='24WIZ'></sub></form><legend id='24WIZ'></legend><bdo id='24WIZ'><pre id='24WIZ'><center id='24WIZ'></center></pre></bdo></b><th id='24WIZ'></th></span></q></dt></tr></i><div id='24WIZ'><tfoot id='24WIZ'></tfoot><dl id='24WIZ'><fieldset id='24WIZ'></fieldset></dl></div>
        • <bdo id='24WIZ'></bdo><ul id='24WIZ'></ul>

            <tfoot id='24WIZ'></tfoot>

                1. 本文介绍了是否有理由不使用链接时优化 (LTO)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  GCC、MSVC、LLVM 和可能的其他工具链支持链接时(整个程序)优化,以允许优化编译单元之间的调用.

                  GCC, MSVC, LLVM, and probably other toolchains have support for link-time (whole program) optimization to allow optimization of calls among compilation units.

                  编译生产软件时是否有理由不启用此选项?

                  Is there a reason not to enable this option when compiling production software?

                  推荐答案

                  我假设 生产软件"是指您交付给客户/投入生产的软件.为什么不总是使用编译器优化?(由 Mankarse) 主要适用于您想要调试代码(因此该软件仍处于开发阶段 - 未投入生产).

                  I assume that by "production software" you mean software that you ship to the customers / goes into production. The answers at Why not always use compiler optimization? (kindly pointed out by Mankarse) mostly apply to situations in which you want to debug your code (so the software is still in the development phase -- not in production).

                  自从我写下这个答案已经过去了 6 年,需要更新.早在 2014 年,问题是:

                  6 years have passed since I wrote this answer, and an update is necessary. Back in 2014, the issues were:

                  • 链接时间优化偶尔会引入微妙的错误,例如参见链接时间优化内核.我认为这在 2020 年不再是一个问题.防范这些类型的编译器和链接器错误:进行适当的测试以检查您即将发布的软件的正确性.
                  • 增加编译时间.有人声称自 2014 年以来情况已显着改善,例如由于 slim对象.
                  • 大量内存使用.这篇文章声称近年来情况有了很大改善,感谢分区.
                  • Link time optimization occasionally introduced subtle bugs, see for example Link-time optimization for the kernel. I assume this is less of an issue as of 2020. Safeguard against these kinds of compiler and linker bugs: Have appropriate tests to check the correctness of your software that you are about to ship.
                  • Increased compile time. There are claims that the situation has significantly improved since 2014, for example thanks to slim objects.
                  • Large memory usage. This post claims that the situation has drastically improved in recent years, thanks to partitioning.

                  从 2020 年开始,我将尝试在我的任何项目中默认使用 LTO.

                  As of 2020, I would try to use LTO by default on any of my projects.

                  这篇关于是否有理由不使用链接时优化 (LTO)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Is Type(::x); valid?(是类型(::x);有效的?)
                  Difference between an inline function and static inline function(内联函数和静态内联函数的区别)
                  Compilation fails randomly: quot;cannot open program databasequot;(编译随机失败:“无法打开程序数据库)
                  Too many initializers error for a simple array in bcc32(bcc32 中的简单数组的初始值设定项过多错误)
                  No Member named stoi in namespace std(命名空间 std 中没有名为 stoi 的成员)
                  Error using a constexpr as a template parameter within the same class(在同一个类中使用 constexpr 作为模板参数时出错)

                    <bdo id='yvXQf'></bdo><ul id='yvXQf'></ul>
                        <tbody id='yvXQf'></tbody>

                      <small id='yvXQf'></small><noframes id='yvXQf'>

                          <legend id='yvXQf'><style id='yvXQf'><dir id='yvXQf'><q id='yvXQf'></q></dir></style></legend><tfoot id='yvXQf'></tfoot>
                          <i id='yvXQf'><tr id='yvXQf'><dt id='yvXQf'><q id='yvXQf'><span id='yvXQf'><b id='yvXQf'><form id='yvXQf'><ins id='yvXQf'></ins><ul id='yvXQf'></ul><sub id='yvXQf'></sub></form><legend id='yvXQf'></legend><bdo id='yvXQf'><pre id='yvXQf'><center id='yvXQf'></center></pre></bdo></b><th id='yvXQf'></th></span></q></dt></tr></i><div id='yvXQf'><tfoot id='yvXQf'></tfoot><dl id='yvXQf'><fieldset id='yvXQf'></fieldset></dl></div>