{"id":35326,"date":"2025-03-25T22:23:36","date_gmt":"2025-03-25T22:23:36","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/cppblog\/?p=35326"},"modified":"2025-03-25T22:23:36","modified_gmt":"2025-03-25T22:23:36","slug":"vs-code-c-extension-updates-4x-faster-colorization-3-5x-faster-project-startup","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/vs-code-c-extension-updates-4x-faster-colorization-3-5x-faster-project-startup\/","title":{"rendered":"VS Code C++ Extension Updates: 4x Faster Colorization &#038; 3.5x Faster Project Startup"},"content":{"rendered":"<p><span data-contrast=\"auto\">In the latest releases of the C++ Extension in Visual Studio Code, we have focused on performance improvements and stability. A fast, responsive, and reliable development environment is essential for maintaining productivity, especially in large and complex C++ projects. These updates include many incremental optimizations that collectively speed up the time from opening a C++ project to writing code with the full suite of C++ features available at your fingertips. Experience these new features for yourself by updating to the <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-vscode.cpptools\">newest version of the C++ Extension<\/a>.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:2,&quot;335551620&quot;:2,&quot;335559738&quot;:240,&quot;335559739&quot;:240,&quot;335559740&quot;:279}\">\u00a0<\/span><\/p>\n<h2 aria-level=\"3\"><span data-contrast=\"none\">Faster Project Startup and Time to Colorization<\/span><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335559738&quot;:160,&quot;335559739&quot;:80}\">\u00a0<\/span><\/h2>\n<p><span data-contrast=\"auto\">Many different optimizations have been made in the C++ extension to provide better initialization performance on project startup and when configuring IntelliSense. If you\u2019re working on a large or complex project on a MacOS or Linux machine, you\u2019ll notice a significant improvement.\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240,&quot;335559740&quot;:279}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Through our testing, we found an average 3.4x speedup on Linux and 3.6x speedup on MacOS . Testing was done with a basic machine using VS Code 1.97.1 and the <\/span><a href=\"https:\/\/pytorch.org\/\"><span data-contrast=\"none\">PyTorch source code<\/span><\/a><span data-contrast=\"auto\">.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240,&quot;335559740&quot;:279}\">\u00a0<\/span><\/p>\n<p><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:2,&quot;335551620&quot;:2,&quot;335559738&quot;:240,&quot;335559739&quot;:240,&quot;335559740&quot;:279}\"> <a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/03\/perf_march_2025_again.png\"><img decoding=\"async\" class=\"wp-image-35328 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/03\/perf_march_2025_again.png\" alt=\"Graph showing the project startup time. for linux it has gone from 67.56 to 19.95 between versions 1.21 and 1.23 of the extenion. For mac it has gone from 71.54 to 19.94\" width=\"506\" height=\"371\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/03\/perf_march_2025_again.png 1693w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/03\/perf_march_2025_again-300x220.png 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/03\/perf_march_2025_again-1024x749.png 1024w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/03\/perf_march_2025_again-768x562.png 768w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/03\/perf_march_2025_again-1536x1124.png 1536w\" sizes=\"(max-width: 506px) 100vw, 506px\" \/><\/a><\/span><\/p>\n<p><span data-contrast=\"auto\">When opening a source file, <\/span><a href=\"https:\/\/code.visualstudio.com\/api\/language-extensions\/semantic-highlight-guide\"><span data-contrast=\"none\">semantic highlighting (colorization)<\/span><\/a><span data-contrast=\"auto\"> is also now much faster. This change is due to the C++ Extension now caching configuration information rather than relying on real-time processing, resulting in much faster configuration access.\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240,&quot;335559740&quot;:279}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Based on our testing, we found an average 4x speedup in the time to file colorization, 4.8x for Linux, and 3.3x for MacOS. This testing was done using VS Code 1.97.1 on a basic machine and colorizing a representative file in the <\/span><a href=\"https:\/\/pytorch.org\/\"><span data-contrast=\"none\">PyTorch source code<\/span><\/a><span data-contrast=\"auto\">.\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240,&quot;335559740&quot;:279}\">\u00a0<\/span><\/p>\n<p><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:2,&quot;335551620&quot;:2,&quot;335559738&quot;:240,&quot;335559739&quot;:240,&quot;335559740&quot;:279}\"><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/03\/time_to_colirzation_march_2025.png\"><img decoding=\"async\" class=\"wp-image-35329 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/03\/time_to_colirzation_march_2025.png\" alt=\"Shows a graph where the time to colorization for linux has decreased from 9.84 to 2.05 seconds between version 1.21 and version 1.23 in the C++ Extension. For Mac, this is 17.49 seconds to 5.25 seconds between the two extension versions,\" width=\"524\" height=\"329\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/03\/time_to_colirzation_march_2025.png 1434w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/03\/time_to_colirzation_march_2025-300x188.png 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/03\/time_to_colirzation_march_2025-1024x642.png 1024w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/03\/time_to_colirzation_march_2025-768x481.png 768w\" sizes=\"(max-width: 524px) 100vw, 524px\" \/><\/a><\/span><\/p>\n<h2 aria-level=\"3\"><span data-contrast=\"none\">Optimizing IntelliSense Configuration<\/span><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335559738&quot;:160,&quot;335559739&quot;:80}\">\u00a0<\/span><\/h2>\n<p><span data-contrast=\"auto\">IntelliSense is the core of the C++ Extension, building your coding experience into a dynamic process with real-time analysis and insights. This ranges from autocompletion to file navigation like \u201cGo to Definition\u201d. But in order for IntelliSense to be able to provide this information, it must understand your project\u2019s configuration. Configuration details, such as compiler settings and include paths, are parsed on project startup. <\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240,&quot;335559740&quot;:279}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">With this release, we optimized the IntelliSense configuration process. The biggest change is that compiler configurations are now cached. A quick retrieval via the database is much faster than identifying and querying the correct compiler every time a project is opened. This leads to faster population of IntelliSense features as seen in the previous section for time to colorization.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240,&quot;335559740&quot;:279}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">We have optimized further by parallelizing different processes during file discovery. For example, determining the relationship between source and header files and lookups of different #include files now happen in parallel, providing faster results. Additionally, an updated path canonicalization process for MacOS and Linux uses better path resolutions to standardize file paths. This eliminates redundancies like relative components, reduces file system access, and improves performance across the different operating systems. <\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240,&quot;335559740&quot;:279}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Beyond configuring with a compiler, we also optimized the process of using alternate methods for configuration, such as custom configurations. It is now faster to reconfigure a custom configuration provider, and the selected C++ configuration can also now be easily switched within the extension. Switching a configuration is available via a new parameter thanks to the work of <\/span><a href=\"https:\/\/github.com\/adrianstephens\"><span data-contrast=\"none\">@adrianstephens<\/span><\/a><span data-contrast=\"auto\">.\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335559685&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240,&quot;335559740&quot;:279}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">We have also expanded support for configuring your project via a compile_commands.json file. A project can now support multiple compile_command.json file, thanks to the contributions of <\/span><a href=\"https:\/\/github.com\/yiftahw\"><span data-contrast=\"none\">@yiftahw<\/span><\/a><span data-contrast=\"auto\">. This makes it easier for build systems that run CMake separately in different repositories to be able to specify which CMake version to use via multiple separate compile_commands files. Additionally, there is now faster processing of large and complex compile_commands.json files, especially for files with thousands of entries. Combined with the new configuration caching, this creates a better startup experience. <\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240,&quot;335559740&quot;:279}\">\u00a0<\/span><\/p>\n<h2 aria-level=\"3\"><span data-contrast=\"none\">Other Enhancements<\/span><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335559738&quot;:160,&quot;335559739&quot;:80}\">\u00a0<\/span><\/h2>\n<p><span data-contrast=\"auto\">Beyond startup time and IntelliSense improvements, we\u2019ve introduced additional enhancements to improve performance and usability:\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240,&quot;335559740&quot;:279}\">\u00a0<\/span><\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"11\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">An improved implementation of file buffers, reducing memory usage while using the extension<\/span><\/li>\n<\/ul>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"11\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-contrast=\"auto\">Additional settings have been added to the C\/C++: Log Diagnostics output for more details on the environment setup and configuration, including modified C_Cpp settings, additionally tracked settings, and the database path used. <\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240,&quot;335559740&quot;:279}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><span data-contrast=\"auto\">To learn more about these changes, please reference the <\/span><a href=\"https:\/\/github.com\/microsoft\/vscode-cpptools\/releases\"><span data-contrast=\"none\">changelog<\/span><\/a><span data-contrast=\"auto\">.\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240,&quot;335559740&quot;:279}\">\u00a0<\/span><\/p>\n<h2 aria-level=\"3\"><span data-contrast=\"none\">What do you think?<\/span><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335559738&quot;:160,&quot;335559739&quot;:80}\">\u00a0<\/span><\/h2>\n<p><a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-vscode.cpptools\"><span data-contrast=\"none\">Download the C\/C++ extension for Visual Studio Code <\/span><\/a><span data-contrast=\"auto\">\u202f<\/span><span data-contrast=\"auto\">today, give it a try, and let us know what you think.\u00a0\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240,&quot;335559740&quot;:279}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">If you have any questions around this release, feel free to start a discussion in <\/span><a href=\"https:\/\/github.com\/microsoft\/vscode-cpptools\/discussions\"><span data-contrast=\"none\">our GitHub repository<\/span><\/a><span data-contrast=\"auto\">. Otherwise, if you run into any issues, please report them in the<\/span><span data-contrast=\"auto\">\u202f<\/span><a href=\"https:\/\/github.com\/Microsoft\/vscode-cpptools\/issues\"><span data-contrast=\"none\">issues section<\/span><\/a><span data-contrast=\"auto\">. We can be reached via the comments below, per email at<\/span><span data-contrast=\"auto\">\u202f<\/span> <a href=\"mailto:visualcpp@microsoft.com\"><span data-contrast=\"none\">visualcpp@microsoft.com,<\/span><\/a><span data-contrast=\"auto\"> or through our team on X\/Twitter at <\/span><span data-contrast=\"auto\">\u202f<\/span><a href=\"https:\/\/twitter.com\/visualc\"><span data-contrast=\"none\">@<\/span><\/a><a href=\"https:\/\/twitter.com\/visualc\"><span data-contrast=\"none\">VisualC.<\/span><\/a><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240,&quot;335559740&quot;:279}\">\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:240,&quot;335559740&quot;:279}\">\u00a0<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the latest releases of the C++ Extension in Visual Studio Code, we have focused on performance improvements and stability. A fast, responsive, and reliable development environment is essential for maintaining productivity, especially in large and complex C++ projects. These updates include many incremental optimizations that collectively speed up the time from opening a C++ [&hellip;]<\/p>\n","protected":false},"author":101195,"featured_media":19546,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1,218,275],"tags":[],"class_list":["post-35326","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cplusplus","category-performance","category-visual-studio-code"],"acf":[],"blog_post_summary":"<p>In the latest releases of the C++ Extension in Visual Studio Code, we have focused on performance improvements and stability. A fast, responsive, and reliable development environment is essential for maintaining productivity, especially in large and complex C++ projects. These updates include many incremental optimizations that collectively speed up the time from opening a C++ [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/35326","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/users\/101195"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=35326"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/35326\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media\/19546"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media?parent=35326"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=35326"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=35326"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}