Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The GitHub Copilot build performance for Windows helps you make your builds faster. It finds expensive headers, template instantiations, and functions and can automatically make your builds more efficient. GitHub Copilot is integrated with Visual Studio.
Prerequisites
- Visual Studio 2026 version 18.3 Insiders 4, or later.
- MSVC Build Tools version 14.50 or later.
- An MSBuild or CMake project.
- Windows 10 or later.
Before you begin
In the Visual Studio 2026 Installer, ensure the following components are selected in the Desktop development with C++ workload:
The desktop development with C++ section is highlighted and C++ Build Insights, C++ profiling tools, and C++ CMake tools for Windows are selected.
Verify your GitHub Copilot subscription
To use GitHub Copilot build performance for Windows, you need a GitHub Copilot Pro, Pro+, Business, or Enterprise subscription.
Verify your GitHub Copilot subscription on GitHub, and then sign in to your GitHub account in Visual Studio 2026.
Verify your GitHub Copilot subscription by signing in to https://github.com. Select your profile picture and then Copilot settings. Your plan type appears near the top of the page:
The Copilot settings page shows the type of subscription. In this case, the user has GitHub Copilot Enterprise.
In Visual Studio, sign in to your GitHub account:
If you're not signed in to GitHub in Visual Studio, open the GitHub Copilot Chat and follow the sign-in instructions in the pop-up window.
Confirm your GitHub sign-in status by selecting your profile picture in Visual Studio. You should see that your GitHub account is Active:
The account dropdown shows that a Microsoft account and a GitHub account are both signed in and active.
Enable template collection
To minimize analysis overhead, the template instantiation time collection is off by default. Turn it on:
- In Visual Studio, go to Tools > Options.
- In the Options dialog, expand Build Insights.
- Select Collect Template Instantiation.
The dialog shows trace collection settings with the Collect template instantiation checkbox selected.
For more information about template instantiation on build time, see Troubleshoot template instantiation impact on build time | Microsoft Learn
Troubleshoot build performance with GitHub Copilot
To start the GitHub Copilot build performance agent:
Open the GitHub Copilot chat pane and type '@'. One of the options is @BuildPerfCpp. Select it:
The GitHub Copilot chat pane shows a list of agents to choose from. Build Perf C p p (optimize your c + + build) is selected.
Select your preferred model in the model drop down menu:
This dropdown lists various models like GPT-5, CLaude Sonnet 4, Gemini 3 Pro, and others.
Instruct GitHub Copilot to improve the build performance of your selected project by typing something like Help me improve the build performance of this project. You can add extra context so that GitHub Copilot can better make suggestions to match the needs of your project.
The GitHub Copilot chat window shows @ Build Per Cpp: Help me improve the build performance of this project.
Permissions
The first time you use GitHub Copilot build performance for Windows, you may need to enable Build Insights and grant elevated permissions to collect MSVC compiler traces.
Visual Studio needs elevated permissions to analyze build performance and the Build Insights tool needs to be enabled. It stays enabled until you disable it. For more information about these permissions, see Build Insights needs additional permissions.
If GitHub Copilot prompts you to enable Build Insights and grant elevated permissions, choose Confirm:
The dialog indicates that Build Insights (vcperf) needs additional permissions to capture MSVC compiler traces. There are Confirm and Deny buttons.
A Visual Studio dialog then appears prompting you to allow a one-time elevated request:
The elevation prompt says: Build Insights (vcperf) needs additional permissions to capture MSVC compiler traces. Allow this one-time elevated request? There are Yes and No buttons.
Choose Yes. The Windows User Account Control dialog then appears:
The dialog asks for permission for the Windows Command Processor, verified publisher Microsoft, to allow this app to make changes to your device. There are Yes and No buttons.
Choose Yes to grant permission to capture the MSVC compiler traces. Denying the elevated request cancels the build analysis.
Guide GitHub Copilot through the process of improving the build time
As you guide GitHub Copilot through the process of improving the build time, it may ask you to provide permission to run tools such as PowerShell scripts:
The prompt asks the user to authorize running the command: ls ../src/ in the terminal. The Confirm dropdown offers: Always allow and Allow in this session. There's also a Deny button.
Choose the level of permission you are comfortable with. If you deny the request, GitHub Copilot can't proceed with the build performance analysis.
Copilot may go through multiple iterations to find the best way to make the build faster. In this chat example, Copilot made its first build performance improvement but recognizes more areas to optimize.
The message indicates that analysis is complete and the build time improved from 78.6 seconds to 70.5 seconds (8.1 seconds faster, ~10.3% improvement). It indicates there's still room for improvement.
When the analysis is done, GitHub Copilot displays a summary of the changes and build performance impact for that iteration:
The summary shows a before and after optimization summary indicating build time, the top bottleneck, and the top five headers that contributed the most to the build time. The report shows build time dropping from 110.7 seconds to 34.1 seconds. It highlights a 69.2% overall improvement and faster incremental rebuilds after enabling precompiled headers.
In this example, build time dropped from 110.7s to 34.1s after enabling precompiled headers for costly includes. A 69% improvement and 3.2Ă— faster builds with near-instant incremental rebuilds.
Other ways to access GitHub Copilot build performance for Windows
You can access the GitHub Copilot build performance for Windows in other ways:
The Build menu:
The Build menu option Run Build Insights is expanded to show Build All, Rebuild All, and Improve Build Performance. The latter is selected.
Select Improve build performance on Solution to open the GitHub Copilot chat window, which prompts you to optimize the build performance of your project.
The chat window shows a prompt to Improve Build Performance.
Or use the Solution window context menu which you can access by right-clicking the solution node:
The context menu shows Build Solution, Build Solution, and so on. Improve build performance on Solution is highlighted.
Select Improve build performance on Solution to open the GitHub Copilot chat window, which prompts you to optimize the build performance of your project.
The chat window shows a prompt to Improve Build Performance.
Or from the Build Insights view:
Select Improve from the Build Insights diagnostics session view to open the GitHub Copilot chat window, which prompts you to optimize the build performance of your project. This button uses data from the existing build insights trace results. It doesn't do a new analysis until the current changes are processed.
The Improve link is highlighted.
The GitHub Copilot chat window is prompted to optimize the build performance of your project, focusing on includes.
The chat window shows a prompt to Improve Build Performance, focusing on includes.
Summary
By combining MSVC Build Insights with GitHub Copilot, you can identify build bottlenecks and apply fixes without manually analyzing trace data or configuring precompiled headers yourself. The workflow handles trace collection, analysis, and code changes in an iterative loop until build times are reduced to your satisfaction.
See also
Build Insights function view
Build Insights included files view
vcperf and Windows Performance Analyzer
Windows Performance Analyzer basics