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

RAR: Save only relevant data to per project disk cache #8636

Closed
Tracked by #8422
ladipro opened this issue Apr 5, 2023 · 0 comments · Fixed by #8909
Closed
Tracked by #8422

RAR: Save only relevant data to per project disk cache #8636

ladipro opened this issue Apr 5, 2023 · 0 comments · Fixed by #8909

Comments

@ladipro
Copy link
Member

ladipro commented Apr 5, 2023

This issue tracks implementing the optimization per https://github.com/dotnet/msbuild/blob/main/documentation/design/rar-core-scenarios.md#save-only-relevant-data-to-the-per-project-disk-cache

Parent user story: #8422

For saving the per-project cache, we should guarantee that after RAR is done, the cache contains exactly the data needed for this specific project. This would be done by keeping track of the items used during RAR execution, and writing those and only those to the cache. Having a cache that's guaranteed to have certain well-defined content after each build is a very good property to have. For instance, in dev box scenarios it would otherwise be hard to reliably "prime" a repo enlistment - the system may prime by building the full solution and then the developer uses the box to build a specific project that happens to have an incomplete cache and get sub-optimal first-time build performance.

Saving of the per-project disk cache may be further optimized by

  • Keeping the timestamp of the cache file in memory and skipping the save if the relevant cache items haven't become dirty (i.e. the dependencies have not changed) and the timestamp of the cache file hasn't changed since the last save. In hot inner loop scenarios this would reduce the save to a timestamp check.
  • Saving the file asynchronously, i.e. not blocking the build on completing the save operation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment