Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • 15:39
    timcassell commented #1813
  • 15:26
    workgroupengineering closed #1813
  • 15:26
    workgroupengineering commented #1813
  • 15:25
    workgroupengineering closed #1815
  • 14:17
    timcassell commented #1813
  • 14:08
    timcassell commented #1813
  • 13:12
    AndreyAkinshin commented #1813
  • 10:34
    AndreyAkinshin commented #1816
  • 10:19

    AndreyAkinshin on master

    Add net7.0 runtime support (#18… (compare)

  • 10:19
    AndreyAkinshin closed #1816
  • 10:18
    AndreyAkinshin milestoned #1816
  • 10:18
    AndreyAkinshin review_requested #1816
  • Sep 27 20:11
    am11 opened #1816
  • Sep 27 16:12
    AndreyAkinshin commented #1810
  • Sep 27 16:10
    workgroupengineering opened #1815
  • Sep 27 15:57

    AndreyAkinshin on master

    Add tests for the case when Par… (compare)

  • Sep 27 15:54
    AndreyAkinshin milestoned #1810
  • Sep 27 15:54
    AndreyAkinshin labeled #1809
  • Sep 27 15:51
    AndreyAkinshin closed #1809
  • Sep 27 15:51

    AndreyAkinshin on master

    Fix null reference exceptions i… (compare)

Lev Yastrebov
If somebody will answer me (I hope :)), please tag me, so I do not miss the answer.
Oleksii Mykhniak

hi, I have a problem with dotnet standard 2.1

dotnet benchmark Test.dll --filter Class1

Unhandled Exception: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types.
Could not load file or assembly 'netstandard, Version=, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
Could not load file or assembly 'netstandard, Version=, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
Could not load file or assembly 'netstandard, Version=, 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, IEnumerable1 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

I'm using BenchmarkDotNet v0.12.1
Antoine Blanchet

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?

Is it possible to deploy and run BDN compiled and without source?
I attempted to use the binaries generated from a run, but it pauses at Before Everything looking for instruction from the runner it seems
Clinton Ingram
I haven't tried it, but it might be possible if you're using the InProcess toolchain
Kristian Wedberg
Hi! When calculating the value of my custom column (IColumn), how do I get the "Mean" running time for the current benchmark case (so that I can show a throughput value)?
Kristian Wedberg
I figured it out: var nanoSeconds = summary.Reports.First(br => br.BenchmarkCase == benchmarkCase).ResultStatistics.Mean;
Kristian Wedberg
How do I hide a default column in the Summary? How do I hide an 'ArgumentSource' column in the Summary (I only use it to pass extra data)?
Hi All
How to add Benchmarkdotnetcore in webapi?
samples here on how to setup bench
it's just standard code bench
if your looking for network benchmark you're looking for the wrong product i think
Luciano Evaristo Guerche (Gorše)
Hi I am using Benchmarkdotnet to benchmark tests which check gauge grpc against webapi. For that, I was already able to use MemoryDiagnoser to get memory allocation, but haven't found any sample on how to plug into System.Net (HttpClient) and collect bytes sent and received. Any clues on how to achieve it?
Is there any Diagnoser to collect bytes sent and received?
are you looking at network load testing ?
because byte sent/receive is network load
there's chances you're using the wrong tool
there's stuff like crankier / bombardier
Luciano Evaristo Guerche (Gorše)
No, just need to figure out the payload (bytes sent/received) to figure out whether or not gRpc is actually the one with smaller payloads.
For load test I usually use JMeter.
you don't need benchmark.net for that right ?
Luciano Evaristo Guerche (Gorše)
It would be a plus to have a Diagnoser which plugs into the System.Net and collects these metrics.
But, if it is/will not feasible to, I can resort to other tools, for sure.
the .AddDebug of the logging stack in aspnetcore dumps bit to the console iirc
so digging in that code will help you finding that up
Hi at all, what is the correct value of LogKind if you want to signal a warning?
Venkatesan R
Hey guys, I am new here. New to even perf testing. May I know how do we do perf testing for methods involving DB calls?
Is there a way to mock them?
just like you said with a mock in code
just like unit test
Venkatesan R
OK, Thanks.
Got it.
make sure your mock are not slow either
Venkatesan R

OK. What about DI? In the Globalsetup, I want to call a service to get data from it and use it in the benchmark code.

Whether benchmarkdotnet allows DI?

I know about parameters. But I am talking about a dictionary holding 1M records/
Hi, I tried to run the Md5VsSha256 benchmark and realized that it was trying to access the network. May I know why and is there a way to run it without the access? My work place has super strict network policy. Using the network proxy is basically not an option :( . (I got HTTP 407 when running the benchmark)

can you use fiddler or wireshqrk to see why
we used to use it in same proxy / ntlm explicit shirtstorm and we had no issue regarding that

a proper network capture would probably be more relevant here to start discussion about the why
you would have the actual target FQDN

telemetry / restore / vscode extensions / ....
too many possibilities to start suspecting while the dumb will be explicit


I trying to write a benchmark for a custom stream class, the programs is something like

public class WriteSequences<T> where T : struct
    private T[]? _data;
    private MyStream? _stream;

    public void GlobalSetup() => _data = ArrayPool<T>.Shared.Rent(8192);

    public void IterationSetup() => _stream = new MyStream();

    public void IterationCleanup() => _stream = null;

    public void GlobalCleanup() => ArrayPool<T>.Shared.Return(_data!);

    [Benchmark(OperationsPerInvoke = 100)]
    public void Encoding_Array() => _stream!.WriteSequence(_data!);

But I keep getting OutOfMemoryException, here MyStream implementation allocates memory when required using new byte[] but the only reference to this arrays is in MyStream, not clear to me how to get this to work

Out of curiosity, are there any beta packages for recent builds of benchmark.net? I've got a CI pipeline that's blocked by dotnet/BenchmarkDotNet#1731, and was wondering if there's a NuGet package I could pick up to get my pipeline running. Thank you for your help!
Is there a way to insert the time for each job to the report in HTML and then a total time. I know I could you stopwatch but wondering if that might conflict with the underlying timing. I am going to be doing a lot of them and want to know when to come back after a run and how long a run with take before I do.
check the reporters class and see if you can tweak that
Andrey Akinshin
@cgranade:matrix.org BenchmarkDotNet v0.13.1 has been released, the changelog could be found here: https://benchmarkdotnet.org/changelog/v0.13.1.html
We publish nightly NuGet package after each successful commit in the master branch; they are available via the following NuGet feed: https://ci.appveyor.com/nuget/benchmarkdotnet
https://www.youtube.com/watch?v=mmza9x3QxYE Intro to Benchmark.net from youtuber IAmTimCorey
Matthew Sitton
I'm having issues running benchmarks for mono with current BenchmarkDotNet version. I'm getting this error when trying to build using mono MsBuild error MSB4237: The SDK resolver type "DotNetMSBuildSdkResolver" failed to load. The type initializer for 'Microsoft.DotNet.MSBuildSdkResolver.VSSettings' threw an exception.
I have mono installed and the following .net sdk installed:
E:\development\NoFrillSMF\NoFrillSMF.Benchmark>dotnet --list-sdks
5.0.202 [C:\Program Files\dotnet\sdk]