Benchmark AoT OptimizationPreference #2496
-
With AoT 8.0 we can define the MSBuild property I would like to run benchmarks to see the difference (Clock Wall tests with How can I create Jobs with different values for this specific setting? |
Beta Was this translation helpful? Give feedback.
Answered by
adamsitnik
Jan 8, 2024
Replies: 1 comment 1 reply
-
Something like this. var config = DefaultConfig.Instance
.AddJob(Job.Default.WithArguments(new Argument[] { new MsBuildArgument("/p:OptimizationPreference=Speed") }).WithId("Speed"))
.AddJob(Job.Default.WithArguments(new Argument[] { new MsBuildArgument("/p:OptimizationPreference=Size") }).WithId("Size"));
BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args, config); |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can also use the
NativeAotToolchainBuilder.IlcOptimizationPreference
and build a dedicated toolchain with different settingsBenchmarkDotNet/src/BenchmarkDotNet/Toolchains/NativeAot/NativeAotToolchainBuilder.cs
Line 124 in 7dacb16