- Notifications
You must be signed in to change notification settings - Fork 5.3k
Replace OPTIMIZE_FOR_SIZE with feature switch #111743
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
Changes from all commits
5412071 eb3fe5c 4f9fad1 4636aba e31d983 b869eea 0c8ae74 77f2636 60297de da36781 File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,98 +1,85 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
| | ||
| <PropertyGroup> | ||
| <TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppCurrent)-browser;$(NetCoreAppCurrent)-wasi;$(NetCoreAppCurrent)-android;$(NetCoreAppCurrent)-ios;$(NetCoreAppCurrent)-tvos</TargetFrameworks> | ||
| <TargetFramework>$(NetCoreAppCurrent)</TargetFramework> | ||
MichalStrehovsky marked this conversation as resolved. Show resolved Hide resolved | ||
| <UseCompilerGeneratedDocXmlFile>false</UseCompilerGeneratedDocXmlFile> | ||
| </PropertyGroup> | ||
| | ||
| <!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. --> | ||
| <PropertyGroup> | ||
| <TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier> | ||
| <OptimizeForSize Condition="'$(TargetPlatformIdentifier)' == 'browser' or '$(TargetPlatformIdentifier)' == 'android' or '$(TargetPlatformIdentifier)' == 'ios' or '$(TargetPlatformIdentifier)' == 'tvos'">true</OptimizeForSize> | ||
| Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member Author There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes, that is the purpose of this PR. To only have one build of this library (#111743 (comment))
Could you please point me to which .targets we need to update? Is it the Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets linked from #111743 (comment)? Member Author There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (To be clear, the OptimizeForSize property controls whether we build System.Linq assembly in a not-fully-compatible manner (see the tests I'm touching where it behaves differently) that has better size characteristics. This PR deletes that build and changes it to always build the compatible Linq implementation. It introduces a feature switch that allows switching to the not-fully-compatible mode. The default for the feature switch is disabled. It can be enabled where the tradeoff is worth it (I have PRs out enabling it in places, linked above). The advantage is that now if a customer runs into the incompatibility, they can just set a property and unblock themselves.) Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think maybe we need both @maraf and for workload Member Author There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you! Folded the BlazorWebAssembly.targets change into dotnet/sdk#46375. WasmFeatures.props change is already part of the PR here. | ||
| <DefineConstants Condition="'$(OptimizeForSize)' == 'true'">$(DefineConstants);OPTIMIZE_FOR_SIZE</DefineConstants> | ||
| </PropertyGroup> | ||
| | ||
| <ItemGroup Condition="'$(OptimizeForSize)' == true"> | ||
| <Compile Include="System\Linq\Skip.SizeOpt.cs" /> | ||
| <Compile Include="System\Linq\Take.SizeOpt.cs" /> | ||
| </ItemGroup> | ||
| | ||
| <ItemGroup Condition="'$(OptimizeForSize)' != true"> | ||
| <Compile Include="System\Linq\AppendPrepend.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\Cast.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\Concat.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\DefaultIfEmpty.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\Distinct.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\Grouping.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\Iterator.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\Lookup.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\OfType.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\OrderedEnumerable.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\Range.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\Repeat.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\Reverse.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\Select.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\SelectMany.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\Skip.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\SkipTake.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\Take.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\Union.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\Where.SpeedOpt.cs" /> | ||
| </ItemGroup> | ||
| | ||
| <ItemGroup> | ||
| <Compile Include="System\Linq\Aggregate.cs" /> | ||
| <Compile Include="System\Linq\AnyAll.cs" /> | ||
| <Compile Include="System\Linq\AppendPrepend.cs" /> | ||
| <Compile Include="System\Linq\AppendPrepend.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\Average.cs" /> | ||
| <Compile Include="System\Linq\Cast.cs" /> | ||
| <Compile Include="System\Linq\Cast.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\Chunk.cs" /> | ||
| <Compile Include="System\Linq\Concat.cs" /> | ||
| <Compile Include="System\Linq\Concat.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\Contains.cs" /> | ||
| <Compile Include="System\Linq\AggregateBy.cs" /> | ||
| <Compile Include="System\Linq\CountBy.cs" /> | ||
| <Compile Include="System\Linq\Count.cs" /> | ||
| <Compile Include="System\Linq\DebugView.cs" /> | ||
| <Compile Include="System\Linq\DefaultIfEmpty.cs" /> | ||
| <Compile Include="System\Linq\DefaultIfEmpty.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\Distinct.cs" /> | ||
| <Compile Include="System\Linq\Distinct.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\ElementAt.cs" /> | ||
| <Compile Include="System\Linq\Enumerable.cs" /> | ||
| <Compile Include="System\Linq\Except.cs" /> | ||
| <Compile Include="System\Linq\First.cs" /> | ||
| <Compile Include="System\Linq\Grouping.cs" /> | ||
| <Compile Include="System\Linq\Grouping.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\GroupJoin.cs" /> | ||
| <Compile Include="System\Linq\Index.cs" /> | ||
| <Compile Include="System\Linq\Intersect.cs" /> | ||
| <Compile Include="System\Linq\Iterator.cs" /> | ||
| <Compile Include="System\Linq\Iterator.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\Join.cs" /> | ||
| <Compile Include="System\Linq\Last.cs" /> | ||
| <Compile Include="System\Linq\LeftJoin.cs" /> | ||
| <Compile Include="System\Linq\Lookup.cs" /> | ||
| <Compile Include="System\Linq\Lookup.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\Max.cs" /> | ||
| <Compile Include="System\Linq\MaxMin.cs" /> | ||
| <Compile Include="System\Linq\Min.cs" /> | ||
| <Compile Include="System\Linq\OfType.cs" /> | ||
| <Compile Include="System\Linq\OfType.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\OrderBy.cs" /> | ||
| <Compile Include="System\Linq\OrderedEnumerable.cs" /> | ||
| <Compile Include="System\Linq\OrderedEnumerable.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\PartialArrayEnumerator.cs" /> | ||
| <Compile Include="System\Linq\Range.cs" /> | ||
| <Compile Include="System\Linq\Range.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\Repeat.cs" /> | ||
| <Compile Include="System\Linq\Repeat.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\Reverse.cs" /> | ||
| <Compile Include="System\Linq\Reverse.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\RightJoin.cs" /> | ||
| <Compile Include="System\Linq\SegmentedArrayBuilder.cs" /> | ||
| <Compile Include="System\Linq\Select.cs" /> | ||
| <Compile Include="System\Linq\Select.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\SelectMany.cs" /> | ||
| <Compile Include="System\Linq\SelectMany.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\SequenceEqual.cs" /> | ||
| <Compile Include="System\Linq\Single.cs" /> | ||
| <Compile Include="System\Linq\SingleLinkedNode.cs" /> | ||
| <Compile Include="System\Linq\Skip.cs" /> | ||
| <Compile Include="System\Linq\Skip.SizeOpt.cs" /> | ||
| <Compile Include="System\Linq\Skip.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\SkipTake.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\Sum.cs" /> | ||
| <Compile Include="System\Linq\Take.cs" /> | ||
| <Compile Include="System\Linq\Take.SizeOpt.cs" /> | ||
| <Compile Include="System\Linq\Take.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\ThrowHelper.cs" /> | ||
| <Compile Include="System\Linq\ToCollection.cs" /> | ||
| <Compile Include="System\Linq\Union.cs" /> | ||
| <Compile Include="System\Linq\Union.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\Utilities.cs" /> | ||
| <Compile Include="System\Linq\Where.cs" /> | ||
| <Compile Include="System\Linq\Where.SpeedOpt.cs" /> | ||
| <Compile Include="System\Linq\Zip.cs" /> | ||
| </ItemGroup> | ||
| | ||
| | ||
Uh oh!
There was an error while loading. Please reload this page.