{"id":24371,"date":"2019-05-28T13:16:20","date_gmt":"2019-05-28T13:16:20","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/cppblog\/?p=24371"},"modified":"2019-05-28T17:30:17","modified_gmt":"2019-05-28T17:30:17","slug":"cmake-3-14-and-performance-improvements","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/cmake-3-14-and-performance-improvements\/","title":{"rendered":"CMake 3.14 and Performance Improvements"},"content":{"rendered":"<p>In <a href=\"https:\/\/visualstudio.microsoft.com\/downloads\/\">Visual Studio 2019 version 16.1<\/a> we have updated the version of CMake we ship inbox to CMake 3.14. This comes with performance improvements for extracting generated build system information. Additionally, we now support virtually all the Visual Studio capabilities regardless of the CMake binary origin so long as the CMake version is at least 3.14. The main reason for this is the introduction of the <a href=\"https:\/\/cmake.org\/cmake\/help\/v3.14\/manual\/cmake-file-api.7.html\">file-based API<\/a>, which we now support, and which provides a new way for retrieving semantic information. This is now the recommended way to connect an IDE to CMake, the old CMake server being deprecated, and we are an early adopter of the feature.<\/p>\n<h2>Visual Studio Performance Improvements<\/h2>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-24407\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2019\/05\/folder_open_perf.png\" alt=\"Graph showing the 2x performance increase from 15.9 to 16.1\" width=\"624\" height=\"131\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2019\/05\/folder_open_perf.png 624w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2019\/05\/folder_open_perf-300x63.png 300w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/p>\n<p>The indexing is now significantly faster for code opened via Open folder, and as a result IntelliSense is available considerably faster than in Visual Studio 2017. As an example, in the <a href=\"https:\/\/nam06.safelinks.protection.outlook.com\/?url=https%3A%2F%2Freleases.llvm.org%2F&amp;data=01%7C01%7CVarun.Gupta%40microsoft.com%7Cc448dee9a12d470c8c1b08d6cf3728d2%7C72f988bf86f141af91ab2d7cd011db47%7C1&amp;sdata=aXAQR6b7COumi3pwL7LHpm911t5WhzGhbwBwm8LCeJ0%3D&amp;reserved=0\">LLVM codebase<\/a>, IntelliSense becomes available at least 2 times faster in Visual Studio 2019. Additionally, a new indexing algorithm lights up IntelliSense incrementally while the folder is being indexed.<\/p>\n<p>In Visual Studio 2017 on average it takes 3 min from the point of opening the LLVM folder, to the point where you have IntelliSense, including generation. In Visual Studio 2019 it takes 1:26 min, including generation.<\/p>\n<h2>CMake 3.14<\/h2>\n<p>We now ship CMake 3.14 in-box with Visual Studio. This contains the new file-based API, and support for the Visual Studio 2019 generators. To see the full set of changes, please see the CMake 3.14 <a href=\"https:\/\/cmake.org\/cmake\/help\/v3.14\/release\/3.14.html\">release notes<\/a>.<\/p>\n<h2>Visual Studio 2019 Generators<\/h2>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-24391\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2019\/05\/cmakegen.png\" alt=\"CMake generator selection box showing Visual Studio 16 2019\" width=\"512\" height=\"139\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2019\/05\/cmakegen.png 512w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2019\/05\/cmakegen-300x81.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/p>\n<p>CMake 3.14 introduces support for the <a href=\"https:\/\/cmake.org\/cmake\/help\/v3.14\/generator\/Visual%20Studio%2016%202019.html\">Visual Studio 2019 generators<\/a>. The new generator is called \u201cVisual Studio 16 2019\u201d, and the platform targeting is simplified. To use a specific platform, use the -A argument. For example, to use the Visual Studio 2019 generator targeting the x64 platform: cmake.exe -G \u201cVisual Studio 16 2019\u201d -A x64<\/p>\n<h2>File-based API<\/h2>\n<p>The <a href=\"https:\/\/cmake.org\/cmake\/help\/v3.14\/manual\/cmake-file-api.7.html\">file-based API<\/a> allows a client to write query files prior to build system generation. During build system generation CMake will read those query files and write object model response files. Prior to this API&#8217;s introduction we were using the <a href=\"https:\/\/cmake.org\/cmake\/help\/latest\/manual\/cmake-server.7.html\">cmake-server<\/a> to get the equivalent information. We\u2018re still supporting the old model, but starting with 3.14 we can now support the new model as well. One of the differences in <a href=\"https:\/\/github.com\/microsoft\/CMake\/tree\/cmake-daemon\">our CMake fork on github<\/a> was the backtrace information needed for our Targets View feature inside Visual Studio. Prior to CMake 3.14 we needed the CMake version from our fork, in order for Targets View to work properly. Now, with the file-based API this is no longer required.<\/p>\n<p>The file-based API provides a simpler, standard path to the future, with official support in CMake itself. We expect most users to see either performance improvements or not notice any degradation of performance. Extracting the information to populate the Visual Studio UI is faster because we are just reading the response files rather than running CMake in long-running server mode, there is less memory usage and less overhead associated with creating and maintaining processes.<\/p>\n<p>These value-added features light up automatically when you update to Visual Studio 2019 version 16.1 Preview 2.<\/p>\n<h2>Send Us Feedback<\/h2>\n<p>Your feedback is a critical part of ensuring that we can deliver the best CMake experience.\u202f We would love to know how <a href=\"https:\/\/visualstudio.microsoft.com\/downloads\/\">Visual Studio 2019 version 16.1<\/a>\u202fis working for you.\u202fIf you have any questions specific to CMake Tools, please reach out to\u202fcmake@microsoft.com or leave a comment.\u202fIf you find any issues or have a suggestion, the best way to reach out to us is to\u202f<a href=\"https:\/\/docs.microsoft.com\/en-us\/visualstudio\/ide\/how-to-report-a-problem-with-visual-studio\">Report a Problem<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Visual Studio 2019 version 16.1 we have updated the version of CMake we ship inbox to CMake 3.14. This comes with performance improvements for extracting generated build system information. Additionally, we now support virtually all the Visual Studio capabilities regardless of the CMake binary origin so long as the CMake version is at least [&hellip;]<\/p>\n","protected":false},"author":4522,"featured_media":24407,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[270],"tags":[],"class_list":["post-24371","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-announcement"],"acf":[],"blog_post_summary":"<p>In Visual Studio 2019 version 16.1 we have updated the version of CMake we ship inbox to CMake 3.14. This comes with performance improvements for extracting generated build system information. Additionally, we now support virtually all the Visual Studio capabilities regardless of the CMake binary origin so long as the CMake version is at least [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/24371","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\/4522"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=24371"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/24371\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media\/24407"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media?parent=24371"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=24371"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=24371"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}