You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/build-insights/tutorials/build-insights-template-view.md
+32-32Lines changed: 32 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ The **Templates** view works like the Build Insights [Functions view](build-insi
21
21
1. Select **Modify** to change your Visual Studio installation.
22
22
1. On the **Individual components** tab, search for and select **C++ Build Insights**, then select **Close** to finish installing the component.
23
23
:::image type="content" source="./media/installer-build-insights.png" alt-text="Screenshot of the Visual Studio Installer. The search box contains C++ Build Insights. The item C++ Build Insights is visible and selected.":::
24
-
24
+
25
25
## Overview
26
26
27
27
Build Insights, integrated into Visual Studio, helps you optimize your build times--especially for large projects like AAA games. Build Insights provides analytics such as the **Templates** view, which shows the time it takes to instantiate each template and which template instantiations add the most to your build time.
@@ -36,55 +36,55 @@ In this article, you create a project that shows how template instantiation affe
36
36
1. Create a header file named `Templates.h`, then replace its contents with the following code:
1. Create a source file named `LargeValue.cpp`, then replace its contents with the following code:
68
68
69
69
```cpp
70
-
#include"Templates.h"
70
+
#include"Templates.h"
71
71
72
72
size_tGetLargeValue()
73
-
{
74
-
return LargeValue();
75
-
}
73
+
{
74
+
return LargeValue();
75
+
}
76
76
```
77
77
78
78
1. Replace the contents of the `TemplateAnalysis.cpp` file with the following code:
79
79
80
80
```cpp
81
-
#include"Templates.h"
81
+
#include"Templates.h"
82
82
83
83
externsize_tGetLargeValue();
84
84
85
85
size_tGetSmallValue()
86
-
{
87
-
return SmallValue();
86
+
{
87
+
return SmallValue();
88
88
}
89
89
90
90
int main()
@@ -107,7 +107,7 @@ Template instantiation time collection is off by default to minimize build overh
107
107
108
108
:::image type="content" source="./media/tools-options-build-insights.png" alt-text="Screenshot of the project property pages dialog. The settings are open to Build Insights > Trace Collection. The Collect Template Instantiation checkbox is selected.":::
109
109
110
-
> [!Note]
110
+
> [!Note]
111
111
> Collecting template instantiation times increases build time due to the extra data collected. Only enable it when you want to analyze template instantiation bottlenecks.
112
112
113
113
## Run Build Insights to get template instantiation data
0 commit comments