Include Cleanup and Diagnostics in Visual Studio
summary
Run Visual Studio Build Insights to find costly headers (project build drops from 461s to 334.12s after cleaning one file), enable Include Cleanup at Tools > Options > Text Editor > C++ > Code Cleanup, then choose Optimize include graph to remove unused includes and add transitively required headers; enable Include Diagnostics from the editor context menu to show CodeLens counts and build-time per header and click references to jump to uses.
AI-written summary · about
related talks
10mStay in tune with your build using Build Insights
01h 00mC++ #include on a Diet
52mNew in Visual Studio: CMake Debugger, Better Diagnostics, and Video Games
53mDebug C++ Without Running
57mC++ MythBusters Strike 2
08mC++ Dynamic Debugging
23mtoolchain-agnostic build time improvements
01h 02mWhat's New in Visual Studio for C++ Developers
