How to filter C++ Build Insights by project

Visual Studio 2022 version 17.14 comes with quality-of-life improvements to its C++ Build Insights integration that will make it easier for you to navigate large multi-project traces and handle long file names for your build inputs and artifacts.

Build insights showcasing all the fles/projects build times and parse counts

What is C++ Build Insights?

C++ Build Insights is a powerful tool that lets you visualize and optimize the build process of your C++ projects. It leverage MSVC’s trace capture technology and uses the Windows ETW framework to collect detailed information about every build event, such as compilation, linking, code analysis, and more. You can then view and analyze this data in many ways, such as a timeline, a flame graph, or a tree map. As of Visual Studio 2022 version 17.7, C++ Build Insights is integrated into Visual Studio.

C++ Build Insights can help you identify and fix bottlenecks, dependencies, and inefficiencies in your build system, resulting in faster and more reliable builds. You can also compare different builds and see how your changes affect the build performance over time. To learn more, read how Activision used Build Insights to cut Call of Duty’s Build Time by 50% on the Microsoft Game Dev Blog.

How to Filter C++ Build Insights by Project

One of the new features in Visual Studio 2022 is the ability to filter your C++ Build Insights results for Visual Studio solutions by project. This can be particularly useful if you have a large solution with multiple projects and you want to focus on one of them. To do this, simply run Build Insights on your solution by selecting Build > Run Build Insights on Solution and then either Build or Rebuild, depending on whether you want to measure the build from scratch. This will generate an ETL (event trace log) trace, which Visual Studio will automatically open to visualize the data collected. Select the project that you want to filter by selecting the funnel next to the Project column and narrowing down the set of projects for which you want to view the data.

How to Filter C++ Build Insights by File Paths

In addition to project filtering, Build Insights now also supports file path filtering, which gives you fine-grained control over which files are included in your analysis. This is especially helpful in large codebases where build data from third-party libraries or generated code can clutter your view. With the File Path Filter, you can use glob patterns to focus on specific directories or file types—helping you isolate and investigate the build performance of just the parts you care about. Whether you’re narrowing your focus during a regression investigation or simply trying to understand the build cost of a particular code change, file path filtering helps you get answers faster.

To do this, simply run Build Insights on your solution by selecting Build > Run Build Insights on Solution and then either Build or Rebuild, depending on whether you want to measure the build from scratch. This will generate an ETL (event trace log) trace, which Visual Studio will automatically open to visualize the data collected. Select the project that you want to filter by selecting the funnel next to the File Path column and typing in the glob pattern you want to focus on or ignore.

How to see the file names and paths of build inputs and artifacts

Another improvement in Visual Studio is the way Build Insights displays the file names and paths of your build inputs and artifacts, such as source files, object files, libraries, and executables. Instead of showing the full path, which can be quite long and hard to read, Build Insights now shows the relative path and the file name, separated by a backslash. This makes it easier to find your build artifacts, especially if you have a complex folder structure.

You can see the file names and paths of your build inputs and artifacts in any view that shows them, such as the Included Files view, which shows the files that are included by each source file during compilation. You can also hover over any build event to see more details, including the file name and path.

We hope you find these quality-of-life improvements useful and that they help you optimize your C++ build process. We are always working on making Visual Studio better for developers, and we appreciate your continuous feedback and suggestions. Please tell us what you think of these features and what else you want in Build Insights.

The post How to filter C++ Build Insights by project appeared first on Visual Studio Blog.

Previous Article

Catch Up on Microsoft Build 2025: Essential Sessions for .NET Developers

Next Article

Emit logs on-demand with log buffering

Write a Comment

Leave a Comment

Your email address will not be published. Required fields are marked *