{"id":33970,"date":"2024-04-15T16:36:16","date_gmt":"2024-04-15T16:36:16","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/cppblog\/?p=33970"},"modified":"2024-04-15T11:37:39","modified_gmt":"2024-04-15T11:37:39","slug":"templates-view-for-build-insights-in-visual-studio-2","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/templates-view-for-build-insights-in-visual-studio-2\/","title":{"rendered":"Templates View for Build Insights in Visual Studio\u00a0"},"content":{"rendered":"<h3 style=\"text-align: left;\" aria-level=\"1\"><span style=\"color: #800080;\" data-contrast=\"none\">Introduction<\/span><\/h3>\n<p><span data-contrast=\"auto\">Introducing the new Templates View feature of Build Insights! Templates View now allows you to capture data about how templates in your codebase are contributing to your build time. This feature is available in Visual Studio 2022 17.10 and later.\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:278}\">\u00a0<\/span><\/p>\n<p><a href=\"https:\/\/visualstudio.microsoft.com\/downloads\/\"><span data-contrast=\"none\">Download Visual Studio 2022<\/span><\/a><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:278}\">\u00a0<\/span><\/p>\n<h3 style=\"text-align: left;\" aria-level=\"2\"><span style=\"color: #800080;\" data-contrast=\"none\">Getting Started with Templates View<\/span><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;201341983&quot;:0,&quot;335559738&quot;:160,&quot;335559739&quot;:80,&quot;335559740&quot;:278}\">\u00a0<\/span><\/h3>\n<p><span data-contrast=\"auto\">To use Build Insights in Visual Studio you will need to ensure you\u2019ve installed the \u201cC++ Build Insights\u201d component. This is installed by default if you\u2019ve installed either the \u201cDesktop development with C++\u201d or \u201cGame development with C++\u201d workloads.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:278}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">By default, Templates View is turned off; To turn on Templates View navigate to the <\/span><b><span data-contrast=\"auto\">Tools <\/span><\/b><span data-contrast=\"auto\">menu and select <\/span><b><span data-contrast=\"auto\">Options&#8230;\u00a0<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:278}\">\u00a0<\/span><\/p>\n<p><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335551550&quot;:2,&quot;335551620&quot;:2,&quot;335559739&quot;:160,&quot;335559740&quot;:278}\"> <a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/04\/options-1.png\"><img decoding=\"async\" class=\"aligncenter wp-image-33969 \" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/04\/options-1.png\" alt=\"Image options\" width=\"285\" height=\"306\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/04\/options-1.png 880w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/04\/options-1-279x300.png 279w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/04\/options-1-768x825.png 768w\" sizes=\"(max-width: 285px) 100vw, 285px\" \/><\/a><\/span><\/p>\n<p><span data-contrast=\"auto\">Select <\/span><b><span data-contrast=\"auto\">Build Insights<\/span><\/b><span data-contrast=\"auto\"> in the list of options and click <\/span><b><span data-contrast=\"auto\">Trace Collection<\/span><\/b><span data-contrast=\"auto\">. This will show the available settings for Build Insights.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:278}\">\u00a0<\/span><\/p>\n<p><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335551550&quot;:2,&quot;335551620&quot;:2,&quot;335559739&quot;:160,&quot;335559740&quot;:278}\"> <a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/04\/settings.png\"><img decoding=\"async\" class=\"aligncenter wp-image-33965 \" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/04\/settings.png\" alt=\"Image settings\" width=\"474\" height=\"273\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/04\/settings.png 516w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/04\/settings-300x173.png 300w\" sizes=\"(max-width: 474px) 100vw, 474px\" \/><\/a><\/span><\/p>\n<p><span data-contrast=\"auto\">In the popup options menu, select the checkbox for <\/span><b><span data-contrast=\"auto\">Template Instantiation Collection<\/span><\/b><span data-contrast=\"auto\">; this will turn on Templates View.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:278}\">\u00a0<\/span><\/p>\n<p><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335551550&quot;:2,&quot;335551620&quot;:2,&quot;335559739&quot;:160,&quot;335559740&quot;:278}\"> <a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/04\/checkbox.png\"><img decoding=\"async\" class=\"aligncenter wp-image-33966 \" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/04\/checkbox.png\" alt=\"Image checkbox\" width=\"502\" height=\"315\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/04\/checkbox.png 676w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/04\/checkbox-300x188.png 300w\" sizes=\"(max-width: 502px) 100vw, 502px\" \/><\/a><\/span><\/p>\n<p><span data-contrast=\"auto\">With the checkbox selected, you can run Build Insights on your project. This action will collect the template data and display it. If you have a trace file from a previous run where the template data was collected, you can open this trace file to view the &#8220;Templates View&#8221; in the report.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:278}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Please note that if you have a trace file that was run without this checkbox turned on, the template data was not collected in that trace file and thus no data will appear in the Templates View. You will need to rerun Build Insights with Templates View turned on if you\u2019d like to see the template data for that project.\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:278}\">\u00a0<\/span><\/p>\n<h3 style=\"text-align: left;\" aria-level=\"2\"><span style=\"color: #800080;\">Using Templates View\u00a0<\/span><\/h3>\n<p><span data-contrast=\"auto\">Templates View highlights the impact of the template instantiations that take the most time in your build. The view only shows instantiations whose contribution exceeds a certain threshold. If you see nothing in the Templates View, it means your build time is not dominated by template instantiations.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:278}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Let\u2019s walk through an example together of how to use Templates View. In a new C++ Console Application project, add a header file called <code>Templates.h<\/code> with the following code snippet:<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:278}\">\u00a0<\/span><\/p>\n<pre class=\"prettyprint language-cpp\"><code class=\"language-cpp\">#pragma once\u00a0\r\n#include &lt;utility&gt;\u00a0\u00a0\r\n#include &lt;vector&gt;\u00a0\u00a0\r\n\r\ntemplate&lt;size_t&gt; struct S1 {};\u00a0\r\ntemplate&lt;int n&gt; using type = std::vector&lt;S1&lt;n&gt;&gt;;\u00a0\r\n\r\ntemplate&lt;size_t...&gt; struct S2 {};\u00a0\r\n\r\ntemplate&lt;typename&gt; struct S3 {};\u00a0\r\ntemplate&lt;size_t... n&gt;\u00a0\r\nstruct S3&lt;std::index_sequence&lt;n...&gt;&gt; {\u00a0\r\n    using type = S2&lt;sizeof(type&lt;n&gt;)...&gt;;\u00a0\r\n};\u00a0\r\n\r\ninline size_t LargeValue() {\u00a0\r\n    return sizeof(S3&lt;std::make_index_sequence&lt;1000&gt;&gt;);\u00a0\r\n};\u00a0\r\n\r\ninline size_t SmallValue() {\u00a0\r\n    return sizeof(S1&lt;5&gt;);\u00a0\r\n} <\/code><\/pre>\n<p><span data-contrast=\"auto\">Then create a source file called <code>LargeValue.cpp<\/code> with the following code:<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:278}\">\u00a0<\/span><\/p>\n<pre class=\"prettyprint language-cpp\"><code class=\"language-cpp\">#include \"Templates.h\"\u00a0\r\nsize_t GetLargeValue() {\u00a0\r\n    return LargeValue();\u00a0\r\n} <\/code><\/pre>\n<p><span data-contrast=\"auto\">Lastly, create a second source file called <code>SmallValue.cpp<\/code> with the below code:<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:278}\">\u00a0<\/span><\/p>\n<pre class=\"prettyprint language-cpp\"><code class=\"language-cpp\">#include \"Templates.h\"\u00a0\r\nsize_t GetSmallValue() {\u00a0\r\n\u00a0 \u00a0 return SmallValue();\u00a0\r\n}<\/code><\/pre>\n<p><span data-contrast=\"auto\">We\u2019ll now run Build Insights on a rebuild of our project to get information about our build time.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:278}\">\u00a0<\/span><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/04\/Screenshot-5.png\"><img decoding=\"async\" class=\"aligncenter wp-image-33977 size-full\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/04\/Screenshot-5-e1712957868901.png\" alt=\"Image Screenshot 5\" width=\"2959\" height=\"658\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/04\/Screenshot-5-e1712957868901.png 2959w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/04\/Screenshot-5-e1712957868901-300x67.png 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/04\/Screenshot-5-e1712957868901-1024x228.png 1024w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/04\/Screenshot-5-e1712957868901-768x171.png 768w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/04\/Screenshot-5-e1712957868901-1536x342.png 1536w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/04\/Screenshot-5-e1712957868901-2048x455.png 2048w\" sizes=\"(max-width: 2959px) 100vw, 2959px\" \/><\/a><\/p>\n<p><span data-contrast=\"auto\">From the Templates View of Build Insights, we can see that two template instantiations of <code>S3<\/code> are taking 83% of the entire build time. The \u201cTranslation Unit\u201d column shows that both <code>SmallValue.cpp<\/code> and <code>LargeValue.cpp<\/code> are causing this template instantiation to be included in the build. The \u201cInstantiation File Path\u201d shows us where the template instantiation happens. We can derive that there\u2019s one expensive template instantiation affecting both of our source files, because the \u201cInstantiation File Path\u201d and the \u201cSpecialization Name\u201d are the same. This also explains why the time of each of the two template instantiations are about equal. Essentially, by including <code>Templates.h<\/code> in both of our source files, we are causing one template instantiation to add almost 6 seconds to our build time.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:278}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Let\u2019s investigate further to find where this template instantiation is located. We know that the instantiation is created in <code>Templates.h<\/code> and we can use the \u201cSpecialization Name\u201d column to determine that the below code is the culprit:<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:278}\">\u00a0<\/span><\/p>\n<pre class=\"prettyprint language-cpp\"><code class=\"language-cpp\">inline size_t LargeValue() {\u00a0\r\n    return sizeof(S3&lt;std::make_index_sequence&lt;1000&gt;&gt;);\u00a0\r\n}; <\/code><\/pre>\n<p><span data-contrast=\"auto\">There are three main ways to decrease the cost of template instantiations. The first way is to review the template in question and determine if it\u2019s being used or not. If it\u2019s not being used, then the easiest solution is to remove the function. In our program,<code>LargeValue()<\/code>is being used by <code>LargeValue.cpp<\/code>, so we cannot remove it. We can also consider removing the include directive(s) that is bringing in this template instantiation. It\u2019s easy to forget to remove header files when you\u2019re no longer using them, and this is a great demonstration of how an include directive can cause a huge impact on build time. However, both of our source files are dependent on <code>Templates.h<\/code> so this will not help us.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:278}\">\u00a0<\/span><\/p>\n<p><span style=\"font-size: 10pt;\"><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/04\/book.svg\"><img decoding=\"async\" class=\"wp-image-33978 alignleft\" role=\"img\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/04\/book.svg\" alt=\"\" width=\"50\" height=\"50\" \/><\/a><strong>Read<\/strong>\u00a0<a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/include-cleanup-in-visual-studio\/\">#include cleanup in Visual Studio &#8211; C++ Team Blog (microsoft.com)<\/a> for more information on decreasing template instantiation cost by removing include directives.\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">The second way is to look at the template instantiation and determine if there is a way to optimize the code. The only optimization possible here is decreasing the size of the index sequence. As a fun exercise, try replacing 1000 with various numbers and see how that impacts the build time. <\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:278}\">\u00a0<\/span><\/p>\n<p><span style=\"font-size: 10pt;\"><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/04\/book.svg\"><img decoding=\"async\" class=\"wp-image-33978 alignleft\" role=\"img\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/04\/book.svg\" alt=\"\" width=\"50\" height=\"50\" \/><\/a><strong>Read<\/strong>\u00a0<a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/build-throughput-series-more-efficient-template-metaprogramming\/\">Build Throughput Series: More Efficient Template Metaprogramming &#8211; C++ Team Blog (microsoft.com)<\/a> for more practice reducing the cost of template metaprogramming. <\/span><\/p>\n<p><span data-contrast=\"auto\">For our purposes, let\u2019s assume that we need an index sequence of 1000. We now need to rely on the third way to decrease template instantiation cost: moving the definition of <code>LargeValue()<\/code> to a source file.\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:278}\">\u00a0<\/span><\/p>\n<p style=\"text-align: left;\"><span style=\"font-size: 10pt;\"><b><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/04\/lightbuld.svg\"><img decoding=\"async\" class=\"wp-image-33987 alignleft\" role=\"img\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/04\/lightbuld.svg\" alt=\"\" width=\"50\" height=\"50\" \/><\/a>Tip: <\/b>If for some reason you need to keep the function in a header file, then you can move the definition to a .inl file. If you move the definition to a .inl file, then ensure the source files which use that function include both the header file and the .inl file.\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\"><code>LargeValue.cpp<\/code> is the only source file that calls <code>LargeValue()<\/code>, so we can move the definition to <code>LargeValue.cpp<\/code>. To do this, remove the current definition of <code>LargeValue()<\/code> from <code>Templates.h<\/code> and replace it with the following declaration:<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:278}\">\u00a0<\/span><\/p>\n<pre class=\"prettyprint language-cpp\"><code class=\"language-cpp\">inline size_t LargeValue();\u00a0\r\n\r\n<\/code><\/pre>\n<p><span data-contrast=\"auto\">Then, inside LargeValue.cpp add the following code snippet:\u00a0<\/span><\/p>\n<pre class=\"prettyprint language-cpp\"><code class=\"language-cpp\">inline size_t LargeValue() {\u00a0\r\n    return sizeof(S3&lt;std::make_index_sequence&lt;1000&gt;&gt;);\u00a0\r\n} <\/code><\/pre>\n<p><span data-contrast=\"auto\">If we rerun Build Insights on a rebuild of the project we can now see the below Templates View:<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:278}\">\u00a0<\/span><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/04\/Screenshot-4.png\"><img decoding=\"async\" class=\"aligncenter wp-image-33976 size-full\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/04\/Screenshot-4-e1712957925348.png\" alt=\"Image Screenshot 4\" width=\"2964\" height=\"491\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/04\/Screenshot-4-e1712957925348.png 2964w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/04\/Screenshot-4-e1712957925348-300x50.png 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/04\/Screenshot-4-e1712957925348-1024x170.png 1024w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/04\/Screenshot-4-e1712957925348-768x127.png 768w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/04\/Screenshot-4-e1712957925348-1536x254.png 1536w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/04\/Screenshot-4-e1712957925348-2048x339.png 2048w\" sizes=\"(max-width: 2964px) 100vw, 2964px\" \/><\/a><\/p>\n<p><span data-contrast=\"auto\">The build time has significantly decreased. While the template instantiation of <code>S3<\/code> is still contributing 76% of the build time, we\u2019ve been able to about half the total time, by only including necessary template instantiations (you can see the count of <code>S3<\/code> is now 1).<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:278}\">\u00a0<\/span><\/p>\n<p style=\"text-align: left;\"><span data-contrast=\"auto\">The techniques used in this example can be applied to larger projects. If multiple files included <code>Templates.h<\/code>, each of those files would have added the instantiation time of <code>LargeValue()<\/code> to the total build time. By moving the definition of <code>LargeValue()<\/code> to a dedicated source file, we can minimize our build time. <\/span><\/p>\n<p><span style=\"font-size: 10pt;\"><b><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/04\/pen.svg\"><img decoding=\"async\" class=\"wp-image-33988 alignleft\" role=\"img\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/04\/pen.svg\" alt=\"\" width=\"50\" height=\"50\" \/><\/a>Try For Yourself:<\/b> Create two more source files in the same C++ console application project we\u2019ve been using above (you should now have four source files in your project). Have all files include the original <code>Templates.h<\/code> (before our optimizations). Run build insights on the project. Now apply the optimizations from the previous example above and ensure only <code>LargeValue.cpp<\/code> has the definition of <code>LargeValue()<\/code>. You should see the build time is decreased by 75%.\u00a0\u00a0<\/span><\/p>\n<h3 aria-level=\"2\"><span style=\"color: #800080;\">Costs Associated with Templates View\u00a0<\/span><\/h3>\n<p><span data-contrast=\"auto\">To collect the template instantiation information from your build, Build Insights utilizes a higher level of data collection than necessary for the other views in Build Insights. It also must perform additional post processing on the data collected. These two factors increase how long it takes Build Insights to generate a report; larger C++ projects will notice this difference more than smaller projects. Due to this increase in time, Templates View is turned off by default.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:278}\">\u00a0<\/span><\/p>\n<h3 aria-level=\"2\"><span style=\"color: #800080;\">Thank You!\u00a0<\/span><\/h3>\n<p><span data-contrast=\"auto\">Thank you to Xiang Fan for adding ETW events to the MSVC compiler so we can track template data. Thank you to Kevin Cadieux for integrating the template ETW events into the Build Insights trace collection. Thank you to Nelson Troncoso for leading the development and design of Build Insights in Visual Studio. Thank you to our former C++ intern and my mentee Hanah Chandley, for her help on adding the Templates View into Visual Studio. Thank you to our developer community, especially our game studio partners, for their suggestions. We are constantly striving to improve Build Insights for Visual Studio and your comments and suggestions help us to do this. If you\u2019d like to share your ideas or experience with us you can comment below, find us on Twitter (<\/span><a href=\"https:\/\/twitter.com\/visualc\"><span data-contrast=\"none\">@VisualC<\/span><\/a><span data-contrast=\"none\">) <\/span><span data-contrast=\"auto\">or email us at<\/span> <a href=\"mailto:visualcpp@microsoft.com\"><span data-contrast=\"none\">visualcpp@microsoft.com<\/span><\/a><span data-contrast=\"auto\">. To open a bug, please see<\/span> <a href=\"https:\/\/developercommunity.visualstudio.com\/report?space=8&amp;entry=problem\"><span data-contrast=\"none\">Visual Studio Feedback<\/span><\/a><span data-contrast=\"none\">.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335557856&quot;:16777215,&quot;335559739&quot;:240,&quot;335559740&quot;:278}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Check out our previous blog posts about Build Insights for Visual Studio:\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:278}\">\u00a0<\/span><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/build-insights-now-available-in-visual-studio-2022\/#getting-started\"><span data-contrast=\"none\">Build Insights Now Available in Visual Studio 2022 &#8211; C++ Team Blog (microsoft.com)<\/span><\/a><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:278}\">\u00a0<\/span><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/functions-view-for-build-insights-in-visual-studio-2022-17-8\/\"><span data-contrast=\"none\">Functions View for Build Insights in Visual Studio 2022 17.8 &#8211; C++ Team Blog (microsoft.com)<\/span><\/a><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:278}\">\u00a0<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Introducing the new Templates View feature of Build Insights! Templates View now allows you to capture data about how templates in your codebase are contributing to your build time. This feature is available in Visual Studio 2022 17.10 and later.\u00a0\u00a0 Download Visual Studio 2022\u00a0 Getting Started with Templates View\u00a0 To use Build Insights in [&hellip;]<\/p>\n","protected":false},"author":155365,"featured_media":33977,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[270,1],"tags":[],"class_list":["post-33970","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-announcement","category-cplusplus"],"acf":[],"blog_post_summary":"<p>Introduction Introducing the new Templates View feature of Build Insights! Templates View now allows you to capture data about how templates in your codebase are contributing to your build time. This feature is available in Visual Studio 2022 17.10 and later.\u00a0\u00a0 Download Visual Studio 2022\u00a0 Getting Started with Templates View\u00a0 To use Build Insights in [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/33970","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/users\/155365"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=33970"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/33970\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media\/33977"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media?parent=33970"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=33970"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=33970"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}