Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Use BenchmarkDotNet and Compile YamlDotNet with Optymize option in Release-* configurations #356
Currently YamlDotNet is compile without optimize option.
When you decompile YamlDotNet (in IlSpy) you can see
It happens because in this project is Release-Signed Release-Unsigned configuration instead of Release. In new csproj inherit from Release configuration doesn't work. There is information about it:
I've added this code in csproj:
<PropertyGroup Condition=" '$(Configuration)' == 'Release-Signed' Or '$(Configuration)' == 'Release-Unsigned' "> <DefineConstants>$(DefineConstants);RELEASE;TRACE</DefineConstants> <DebugSymbols>false</DebugSymbols> <DebugType>portable</DebugType> <Optimize>true</Optimize> </PropertyGroup>
I've used also BenchmarkDotNet to prove it. BenchmarkDotNet in default configuration throw errors about non-optimized dll. This is also visible in performance:
I've added YamlDotNet.PerformanceTests.v5.2.1 project with current avaliable YamlDotNet version.
Of course I've updated YamlDotNet.PerformanceTests.Runner too. Generates a similar table as before. You can see the example above.