Closed ElektroKill closed 1 year ago
If this is green-lighted, I can contribute this change.
Sure. I just checked the csproj file and we have this, does it also need to be updated?
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="System.Reflection.Emit" Version="4.7.0" />
<PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.7.0" />
</ItemGroup>
The new versions of .NET offer additional API's which can be used by Roslyn when compiling C# code to generate more performant code. One of the most notable changes for codegen is the use of string-builder-like on stack structs for string interpolation instead of the classic concatenation calls or format calls.
Adding
net6.0
as a TFM would allow Roslyn to apply these optimizations when compiling for that target.dnlib
consumers could then benefit from improved string performance when using dnlib.Note: I have no ran any benchmarks and the performance improvements are theoretical.