Introduction
We’re excited to announce that Build Insights is now integrated with Visual Studio 2022! Available in Visual Studio 2022 17.7 Preview 2, Build Insights provides critical information of your development environment. Using the analysis created by Build Insights, you will now have the power to effectively optimize your build times, especially large projects like AAA games. With Build Insights now integrated with Visual Studio, you will be able to capture your ETL trace and see your build analytics from within Visual Studio with only a few clicks. As a first step, you will be able to use the Include File and Include Tree views to analyze and optimize your #include usage. Additionally, you no longer need to install external components or run vcperf from the command line. Build Insights integration will work for both MSBuild and CMake projects.
We are deeply grateful to everyone, especially our game developer partners, who shared their feedback on Developer Community and during development of Build Insights. Your invaluable feedback has made all this possible.
Getting Started
Build Insights integration is enabled by default in the Visual Studio Installer. You can find C++ Build Insights in the “Desktop development with C++” and “Game development with C++” workloads.
Capturing Build Insights Trace
To start using Build Insights, first capture a trace by selecting Build from the top menu, followed by either Run Build Insights on Solution, Run Build Insights on [Project_Name], or Run Build Insights on Selection.
When your build is complete, a trace file will automatically pop up in an Editor Window, providing a visual analysis of your build.
To save this trace for future reference, go to ‘File’ > ‘Save [Trace].etl As…’.
Parsing Insights with Included Files View
In the Included Files View, you’ll see how each file contributes to the overall build time, determined by the number of times it is parsed. Files that take up 10% or more of the build time will be marked with a flame symbol that indicates priority files for troubleshooting. You can optimize these files using methods like implementing precompiled headers or minimizing unnecessary inclusions. You can refer to this blogpost for a precompiled header optimization.
Diving Deeper with Include Tree View
Include Tree View offers a more granular perspective of your project. It presents the #included hierarchy of all the files in the trace, providing a crystal-clear view of your project’s structure and highlighting potential areas for improvement. From any view, you can access the selected file by double clicking, pressing enter, or from the context menu of the selected table entry.
Navigation Simplified
You can navigate to source files by using the context menu, double-clicking, or pressing Enter in any table entry. Also, for those moments when you want to switch your perspective, we added the “Show in [View]” option. This functionality enables you to seamlessly transition between the Included Files View and Include Tree View.
Designed for Everyone
One of the main principles guiding the design of Build Insights is the aim to simplify the process of capturing and visualizing information within the same platform. Nevertheless, based on feedback, we know some users still would like to use WPA to go deeper in their investigation. We simplified that workflow by bundling WPA with the C++ workloads and added a button to open the trace directly within Visual Studio.
To see Build Insights integration in action, please see the following session I recorded for Pure Virtual C++ Conference 2023.
Known Issues
We are aware of a couple of current issues and are actively working to resolve them in the next Visual Studio previews:
- (Fixed in 17.7 Preview 3) Incorrect Flame Icons: For certain projects, especially those with a significant number of parallel tasks, flame icons may erroneously appear for files that don’t meet the criteria (files taking up 10% or more of the build time).
- Empty Project Column: We acknowledge that this is not the intended behavior. We are currently working on a fix.
Discover More: Functions View
Visual Studio 2022 17.8, we introduced another view that could significantly enhance your build times. The new view is Functions View. It’s designed to offer insights into functions code generation times and forceinlines. Forceinlines, commonly used to boost runtime efficiency, can also influence build times.
For a detailed exploration of this feature, how it can benefit your projects, and tips on how to make the most of it, be sure to read our dedicated blog post:
Functions View for Build Insights in Visual Studio 2022 17.8
Send us your feedback!
We hope Build Insights helps you by providing the critical information needed to optimize your build times and speed up your build iteration time. Download the latest preview version of Visual Studio and give it a try.
Please let us know your thoughts and what additional capabilities you’d like to see from this feature next! We are actively developing this feature set and would love to hear what would improve your workflow even more. The comments below are open for us to track any requests. You can also find us on Twitter (@VisualC) or via email at visualcpp@microsoft.com. To open a bug, please see Visual Studio Feedback.
0 comments