var summaryStyle = new SummaryStyle
{
PrintUnitsInHeader = true,
PrintUnitsInContent = false,
SizeUnit = SizeUnit.B,
TimeUnit = TimeUnit.Nanosecond
};
config = config.With(summaryStyle);
LangVersion
is set to preview
? I want to test some stuff I'm writing for .NET 5.0 and I need to use C# 9 features, but when I have preview
in play, I get:error MSB4086: A numeric comparison was attempted on "$(LangVersion)" that evaluates to "preview" instead of a number, in condition "'$(LangVersion)' == '' Or '$(LangVersion)' < '7.3'".
hi all, I have a question regarding benchmarkdotnet setup, read the docs but I can't seem to find the solution for it. Maybe this isn't the right tool or I (plan to) use it wrong.
Say you have a library you want to perf test with FunctionA() which calls into a lot of code internal to the lib. You want to benchmark the perf of FunctionA() accross multiple versions of the library. Is there a way to automate this "version switching" with benchmarkdotnet? I can't seem to find it
hi, I have a problem with dotnet standard 2.1
command:
dotnet benchmark Test.dll --filter Class1
exception:
Unhandled Exception: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types.
Could not load file or assembly 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
Could not load file or assembly 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
Could not load file or assembly 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeModule.GetTypes()
at System.Reflection.Assembly.GetTypes()
at BenchmarkDotNet.Extensions.ReflectionExtensions.GetRunnableBenchmarks(Assembly assembly) in W:\Work\BenchmarkDotNet\src\BenchmarkDotNet\Extensions\ReflectionExtensions.cs:line 131
at BenchmarkDotNet.Running.TypeFilter.GetTypesWithRunnableBenchmarks(IEnumerable1 types, IEnumerable
1 assemblies, ILogger logger) in W:\Work\BenchmarkDotNet\src\BenchmarkDotNet\Running\TypeFilter.cs:line 34
at BenchmarkDotNet.Running.BenchmarkSwitcher.RunWithDirtyAssemblyResolveHelper(String[] args, IConfig config) in W:\Work\BenchmarkDotNet\src\BenchmarkDotNet\Running\BenchmarkSwitcher.cs:line 92
at BenchmarkDotNet.Running.BenchmarkSwitcher.Run(String[] args, IConfig config) in W:\Work\BenchmarkDotNet\src\BenchmarkDotNet\Running\BenchmarkSwitcher.cs:line 67
at BenchmarkDotNet.Tool.Program.OnExecute() in W:\Work\BenchmarkDotNet\src\BenchmarkDotNet.Tool\Program.cs:line 44
--- End of stack trace from previous location where exception was thrown ---
at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.Invoke(MethodInfo method, Object instance, Object[] arguments)
at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.OnExecute(ConventionContext context)
at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.<>cDisplayClass0_0.<<Apply>b0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.<>cDisplayClass138_0.<OnExecute>b0()
at BenchmarkDotNet.Tool.Program.Main(String[] args) in W:\Work\BenchmarkDotNet\src\BenchmarkDotNet.Tool\Program.cs:line 26
Hi ! I'm trying to run a benchmark on netcoreapp3.1, net48 and Mono using the same console app. I added the different target frameworks in my csproj and it works for both netcoreapp3.1 and net48 but I get compilation errors for mono. The only way I get mono to work is by isolating it in its own project targeting net48 only.
I'm trying to run the sample Md5VsSha256
in an otherwise empty project. Using benchmarkdotnet 0.12.1.
Am I missing something?