This serializes the invocation of crossgen2 for each reference. It seems likely that invoking many copies in parallel is likely to reduce build wall-clock time, especially on many-core dev desktops.
Ideally, the task would get all the inputs at once and use MSBuild's throttling mechanisms (RequestCores/ReleaseCores) to avoid oversubscribing the machine if many projects are running R2R at once.
Feel free to reach out to me or the MSBuild team with any questions.
I was looking through a build binlog and noticed that there is target batching going on in
_CreateR2RImages
:https://github.com/dotnet/runtime/blob/21c52fa8ce11fab02d4b166718f6165553c6977c/src/tasks/Crossgen2Tasks/Microsoft.NET.CrossGen.targets#L465-L467
This serializes the invocation of
crossgen2
for each reference. It seems likely that invoking many copies in parallel is likely to reduce build wall-clock time, especially on many-core dev desktops.Ideally, the task would get all the inputs at once and use MSBuild's throttling mechanisms (
RequestCores
/ReleaseCores
) to avoid oversubscribing the machine if many projects are running R2R at once.Feel free to reach out to me or the MSBuild team with any questions.