1. <legend id='m1aRs'><style id='m1aRs'><dir id='m1aRs'><q id='m1aRs'></q></dir></style></legend>

        • <bdo id='m1aRs'></bdo><ul id='m1aRs'></ul>

        <tfoot id='m1aRs'></tfoot>

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

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

        剖析 C++ 编译过程

        时间:2023-10-17

        • <legend id='LWkHg'><style id='LWkHg'><dir id='LWkHg'><q id='LWkHg'></q></dir></style></legend>
            <tbody id='LWkHg'></tbody>
            <bdo id='LWkHg'></bdo><ul id='LWkHg'></ul>
          • <tfoot id='LWkHg'></tfoot>

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

                1. <small id='LWkHg'></small><noframes id='LWkHg'>

                  本文介绍了剖析 C++ 编译过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我倾向于编写相当大的模板化头文件 C++ 库,我的用户通常会抱怨编译时间.想了想之后,我突然想到我不知道时间都去哪儿了.是否有一些简单的方法可以使用通用编译器(例如 g++、icc 和 xlC)来分析 C++ 编译过程?例如,是否有可能了解在 C++ 编译的每个阶段中花费了多少时间??

                  I tend to write rather large templated header-only C++ libraries and my users commonly complain about compilation times. After thinking about the matter, it occurred to me that I have no idea where the time is going. Is there some simple way to profile the C++ compilation process with common compilers, such as g++, icc, and xlC? For instance, is it possible to get an idea of how much time is spent within each of the phases of C++ compilation?

                  推荐答案

                  对于 GCC 有 调试选项 以查找在 C++ 编译的每个阶段花费了多少时间?

                  -Q使编译器在编译时打印出每个函数名称,并在完成时打印有关每次传递的一些统计信息.

                  -Q Makes the compiler print out each function name as it is compiled, and print some statistics about each pass when it finishes.

                  -ftime-report使编译器在完成时打印一些有关每次传递所消耗的时间的统计信息.

                  -ftime-report Makes the compiler print some statistics about the time consumed by each pass when it finishes.

                  通行证在GCCINT 9:编译器的通行证和文件中进行了描述.

                  Passes are described in GCCINT 9: Passes and Files of the Compiler.

                  您可以在此处使用 -v -ftime-report 将单个源文件的 g++ 编译输出发布到 讨论它.GCC 邮件列表上可能有一些帮助.

                  You can post output of g++ compilation of single source file with -v -ftime-report here to discuss it. There could be some help on the GCC mailing list.

                  对于GCC 以外的编译器(或 GCC 比/gcc/Debugging-Options.html">3.3.6) 查看此线程中的其他选项.

                  For compilers other than GCC (or GCC more ancient than 3.3.6) see the other options in this thread.

                  这篇关于剖析 C++ 编译过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                    <legend id='80cYt'><style id='80cYt'><dir id='80cYt'><q id='80cYt'></q></dir></style></legend>
                      <bdo id='80cYt'></bdo><ul id='80cYt'></ul>
                    • <tfoot id='80cYt'></tfoot>

                      <small id='80cYt'></small><noframes id='80cYt'>

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