Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 10 2016 13:26
    martinwoodward unassigned #296
  • Nov 10 2016 13:26
    martinwoodward unassigned #295
  • Nov 10 2016 13:26
    martinwoodward unassigned #293
  • Nov 10 2016 13:26
    martinwoodward unassigned #294
  • Nov 10 2016 13:26
    martinwoodward unassigned #292
  • Nov 10 2016 13:26
    martinwoodward unassigned #291
  • Nov 10 2016 13:26
    martinwoodward unassigned #288
  • Nov 10 2016 13:26
    martinwoodward unassigned #286
  • Nov 10 2016 13:26
    martinwoodward unassigned #287
  • Nov 10 2016 13:26
    martinwoodward unassigned #285
  • Nov 10 2016 13:26
    martinwoodward unassigned #281
  • Nov 10 2016 13:26
    martinwoodward unassigned #280
  • Nov 10 2016 13:26
    martinwoodward unassigned #278
  • Nov 10 2016 13:26
    martinwoodward unassigned #273
  • Nov 10 2016 13:26
    martinwoodward unassigned #271
  • Nov 10 2016 13:26
    martinwoodward unassigned #276
  • Nov 10 2016 13:26
    martinwoodward unassigned #272
  • Nov 10 2016 13:26
    martinwoodward unassigned #275
  • Nov 10 2016 13:26
    martinwoodward unassigned #268
  • Nov 10 2016 13:26
    martinwoodward unassigned #265
Steffen Forkmann
@forki
Ok just saw it outputs csv
That's good enough for me
Johan Larsson
@JohanLarsson
image.png
What happens here? Stuck for quite a while.
Adam Sitnik
@adamsitnik
for how long?
Johan Larsson
@JohanLarsson
A couple of minutes
I did not time it though so pinch of salt
It is a beautiful library you guys have made, thanks!
Adam Sitnik
@adamsitnik
did it hang for infinite or continued?
if it did not hang it was most probably running benchmarks in the silent mode (when diagnoser is used we performed an extra run without prining anything to console to not allocate any memory)
Johan Larsson
@JohanLarsson
It continued
Ah, ok thanks, was just curious
Adam Sitnik
@adamsitnik
so it was the diagnoser
np, thanks for using it!
Johan Larsson
@JohanLarsson
 |                        Method |     Mean |    Error |   StdDev |     Gen 0 |    Gen 1 | Allocated |
 |------------------------------ |---------:|---------:|---------:|----------:|---------:|----------:|
 | RunOnIDisposableAnalyzers | 483.1 ms | 9.624 ms | 12.85 ms | 6812.5000 | 250.0000 |  41.12 MB |
quite a chunk of memory allocated so that can explain why it took a while
Adam Sitnik
@adamsitnik
;)
Johan Larsson
@JohanLarsson
I have some work to do :)
Should get that down under 10 ms
Adam Sitnik
@adamsitnik
good luck!
Johan Larsson
@JohanLarsson
Is there a way to get a more detailed report from the memory diagnoser?
Adam Sitnik
@adamsitnik
@JohanLarsson no, you need to use some Memory Profiler
Johan Larsson
@JohanLarsson
Ok, was just curious, very reasonable limitation of scope.
I'll try to set up DotMemoryUnit, don't remember if it can run on AppVeyor.
Is there a config option for where the artifacts directory gets created?
I tried searching but only found issues with circular references :)
Adam Sitnik
@adamsitnik
we don't allow for the customization of the folder for artifacts
but we have issue for that ;)
Johan Larsson
@JohanLarsson
Seems like it gets placed in the code when using SDK type projects
image.png
With old project type it was placed in bin/release iirc
Johan Larsson
@JohanLarsson
Slighty annoying since R# checks them then and finds warnings
image.png
Adam Sitnik
@adamsitnik
you can switch to our new gitter channel https://gitter.im/dotnet/BenchmarkDotNet
and ask Andrey who is the author of BDN and also developer at Jetbrains
how to exclude this folders with R#
Johan Larsson
@JohanLarsson
Ah, did not know about that one, thanks
David Malley Rosensteel
@davidRosensteel
Hello! I had a quick question. How do I attach a debugger to a test?
David Malley Rosensteel
@davidRosensteel
Nevermind, just easier to make a method calling each test from a section of code that can be debugged.
darksonwolf
@darksonwolf
hi I have a VS Solution which contains several class library project. I want to use BenchmarkDotNet in test project. I use NUnit and my code is like following .
the code will be run but it does not produce report for me. please advise me where is my mistake?

using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
using NUnit.Framework;
using System;
using System.Security.Cryptography;

namespace Tec.ContentExtractor.Tests
{
    public class Md5VsSha256Bench
    {
        private const int N = 10000;
        private readonly byte[] data;

        private readonly SHA256 sha256 = SHA256.Create();
        private readonly MD5 md5 = MD5.Create();

        public Md5VsSha256Bench()
        {
            data = new byte[N];
            new Random(42).NextBytes(data);
        }

        [Benchmark]
        public byte[] Sha256() => sha256.ComputeHash(data);

        [Benchmark]
        public byte[] Md5() => md5.ComputeHash(data);
    }

    [TestFixture]
    public class Class1
    {

        [Test]
        public void BenchMarkCore()
        {
            var summery  = BenchmarkRunner.Run<Md5VsSha256Bench>();
        }
    }
}
Adam Sitnik
@adamsitnik
hi @darksonwolf
by default BenchmarkDotNet prints output to console
in case of NUNit you need to create some custome logger which will redirect our output to what you see
this is our logger which we use for xUnit
you need to create something similar
or if you are not interested in the displayed info, just write some asserst using the output of BenchmarkRunner.Run
we do something similar here
if you don't want to write any asserts, you should create console app and just call BenchmarkRunner from Main
like we do in our samples project
darksonwolf
@darksonwolf
@adamsitnik thanks