Visual Studio: Improve performance of parsing project file #88949
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Visual Studio doesn't handle string parsing very well, so having all the files in one property slows down VS a lot when loading the projects. Splitting the files up into per-directory properties brings down project processing times from 20 seconds to 1 second (on my machine).
Also adding a
vsproj_props_only
flag to skip touching the vcxproj and sln files when regenerating the project files. This is so the rebuild command in VS can regenerate the build-specific project files without throwing away user customizations to the project. This flag is off by default, and only enabled in the Rebuild All command from VS (or if the user passes it on the command line).Note: All the build-specific information is in the generated.props files, and the vcxproj and sln files only contain the generic list of platform configurations available to VS. The only time both sln and vcxproj file can change is when adding new platforms, and the only time the vcxproj file can change (but not the sln) is when adding/removing files (and this doesn't affect the build itself, but only the file listing in the VS Solution Explorer). All other build system changes only affect the .generated.props files. Therefore, most of the time, it's safe to regenerate only the generated.props files and not touch the vcxproj or sln files.