ilammy / msvc-dev-cmd

GitHub Action to setup Developer Command Prompt for Microsoft Visual C++
MIT License
338 stars 49 forks source link

Avoid slow "vswhere" calls #14

Closed ilammy closed 4 years ago

ilammy commented 4 years ago

Recently added Visual Studio location with vswhere (#11) seems to be very slow when using -find with path patterns. As in, 5 minutes slow (#12).

vswhere does not provide much insight into why this happens, but I guess that's because filesystem operations (and search in particular) are not very fast on Windows.

Improve the search performance by combining vswhere with probing. Use vswhere to locate the installation root, and then probe around for the batch script we need.

Also, don't use vswhere for Visual Studio 2015 as it does not seem to work. Rely only on probing here.

And also, add some debug logs so that it's possible to track which path has been used, if you're interested in it.

/cc @aminya

aminya commented 4 years ago

If this increases the speed sure! In a local configuration my code only took seconds! The main problem should be the GitHub servers.