-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
Description
Changing an item include to include some additional metadata resulted in extreme slowdowns for me, especially on Linux:
| OS | Without metadata | With metadata |
|---|---|---|
| Windows | 10 ms | 8234 ms |
| Linux | 68 ms | 143022 ms |
The change that caused this was changing from:
<_RuntimeTargetPublishItems Include="@(FileDefinitions)" Exclude="@(__RuntimeTargetPublishItems)" />To:
<_RuntimeTargetPublishItems Include="@(FileDefinitions)" Exclude="@(__RuntimeTargetPublishItems)"
DestinationSubPath="%(FileDefinitions.Path)" />Repro steps
git clone https://github.com/dsplaisted/msbuild-slow-batchingcd msbuild-slow-batchingcd TestAppdotnet build /clp:PerformanceSummary- Observe the difference in execution time between the FastBatching and SlowBatching targets in the performance summary
EXPECTED: Execution times are comparable
ACTUAL: SlowBatching execution time is several orders of magnitude slower than FastBatching
Repro details
The repro project is an app targeting netcoreapp1.1 referencing a library which targets netstandard1.5. The app project has the following targets added to it:
<Target Name="SetupItemsForBatching" AfterTargets="Build" DependsOnTargets="_ComputeLockFileCopyLocal">
<ItemGroup>
<TestItems1 Include="@(_ActiveTFMFileDependencies->WithMetadataValue('FileGroup', 'RuntimeTarget'))" />
<TestItems2 Include="@(FileDefinitions)" Exclude="@(TestItems1)" />
</ItemGroup>
</Target>
<Target Name="SlowBatching" AfterTargets="Build" DependsOnTargets="SetupItemsForBatching">
<ItemGroup>
<SlowBatchItems Include="@(FileDefinitions)" Exclude="@(TestItems2)"
DestinationSubPath="%(FileDefinitions.Path)"/>
</ItemGroup>
</Target>
<Target Name="FastBatching" AfterTargets="Build" DependsOnTargets="SetupItemsForBatching">
<ItemGroup>
<FastBatchItems Include="@(FileDefinitions)" Exclude="@(TestItems2)" />
</ItemGroup>
</Target>Reactions are currently unavailable