Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSBuild caching #1021

Merged
merged 1 commit into from
Aug 15, 2024
Merged

MSBuild caching #1021

merged 1 commit into from
Aug 15, 2024

Conversation

adamralph
Copy link
Owner

@adamralph adamralph commented Jul 20, 2024

With this change, the version is calculated once (per thread used by the SDK) and then cached.

For solutions with many projects, this can significantly reduce build time.

@adamralph adamralph added the enhancement New feature or request label Jul 20, 2024
@adamralph adamralph self-assigned this Jul 20, 2024
@adamralph adamralph requested a review from bording July 20, 2024 16:25
@adamralph
Copy link
Owner Author

@bording what do you think of this as a lightweight alternative to #989?

I was thinking it would be nice if MSBuild exposed tasks which could read and write from the build cache, so I went ahead and wrote those tasks. I could even see those potentially being contributed to MSBuild.

@adamralph
Copy link
Owner Author

FWIW, I tested this with https://github.com/Particular/ServiceControl, and a single threaded build went from 43 seconds to 24 seconds.

@adamralph
Copy link
Owner Author

testing the water with dotnet/msbuild#10418

Copy link
Collaborator

@bording bording left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall I still prefer moving all the logic to an MSBuild task instead of calling other processes during the build, but this seems like an okay intermediate step.

@adamralph adamralph merged commit 1f5df0c into main Aug 15, 2024
28 checks passed
@adamralph adamralph deleted the msbuild-caching branch August 15, 2024 11:47
@adamralph
Copy link
Owner Author

@bording I've released this in 5.1.0-rc.1—please feel free to give it a try.

@adamralph adamralph added this to the 5.1.0 milestone Aug 15, 2024
@adamralph
Copy link
Owner Author

re-released as 6.0.0-rc.1 because the next release contains at least one breaking change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants