runtime: Most of libs partition is not incrementally buildable
Running build clr+libs -ninja
and then build libs -ninja
results in 217 csc invocations when there should be 0.
It looks like system which creates *.Forwards.cs
files may not be incremental.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 20 (17 by maintainers)
I had some time during my vacation and stumbled upon this problem and submitted the following PRs to fix that:
I also filed https://github.com/dotnet/sdk/issues/23517 which causes 111 seconds being spent on re-validating something that shouldn’t run in an incremental no-op packaging operation.
EDIT: With all these changes combined (including https://github.com/dotnet/arcade/commit/8c1b3ebd48e863ecad85380d6509fba7076917f7 and https://github.com/dotnet/arcade/commit/1c78e4313e8dc240587f95938e8dcb298d1379d4 which make the build even faster), a libraries subset no-op incremental build (without tests) only takes 70 seconds on my Surface Book 2. On a dev PC tower probably less than a minute.
Here are the remaining Top 10 running tasks:
Summary:
Well I think the long pole is how long its taking to evaluate the projects:
When I developed static graph-based restore, I was using a project tree with 750 projects which took 4 seconds to do a no-op restore. This repo is 1,686 projects and is taking 13.6 seconds (8ms per project on average). That is pretty darn fast in my opinion 😃 The NuGet side of things is only taking 3 seconds to determine that everything is up-to-date.
MSBuild does not cache evaluations from build to build so I’m not sure how to make this faster. We’d have to look at evaluations to see if we could speed it up. Static graph-based restore disables globs (stuff like *.cs) so that’s unlikely causing slowness. The evaluations and builds also very parallel but if the project tree’s dependencies are in declared in such a way, we could see less parallelism. @rainersigwald what’s your opinion, is there anything we can do to make evaluating 1,686 projects faster than 13 seconds?