These are chat archives for PerfDotNet/BenchmarkDotNet

1st
Dec 2015
Andrey Akinshin
@AndreyAkinshin
Dec 01 2015 03:58
@Metallium, right now you can reduce amount of processes (the first parameter of BenchmarkTask) , amount of warmup and target iterations (the two last parameters). E.g., processCount=1, warmupIterationCount=3, targetIterationCount=5. I am trying to implement smart logic that will be adjust these parameters based on you benchmark: if you really don't need super precision, benchmarking will perform quickly. Hopefully, new logic will be published in December.
Tommy Long
@smudge202
Dec 01 2015 08:45
^ This would be great @AndreyAkinshin .
Btw, I took a look at the public API last night. I actually only found that one usage of Exec, everything else looked fine.
Andrey Akinshin
@AndreyAkinshin
Dec 01 2015 10:03
This message was deleted
@smudge202, cool. Waiting for your PR.
Nikita
@Metallium
Dec 01 2015 11:21
it would be great to flexible setup
already tried to lower iteration counts - benchmark still takes a lot)
Matt Warren
@mattwarren
Dec 01 2015 11:47
You can also do this:
[BenchmarkTask(mode: BenchmarkMode.SingleRun, processCount: 1, warmupIterationCount: 1, targetIterationCount: 1)] i.e. "SingleRun"
Tommy Long
@smudge202
Dec 01 2015 11:48
I haven't checked, but is it possible to inherit from BenchmarkTaskAttribute and assign default properties through the base ctor?
For example, allowing @Metallium to create a QuickBenchmarkTaskAttribute with settings as you've described.
Matt Warren
@mattwarren
Dec 01 2015 11:49
good question, I'm not sure either?
Tommy Long
@smudge202
Dec 01 2015 11:50
Pretty sure it isn't sealed. Will have to check the discoverer
Matt Warren
@mattwarren
Dec 01 2015 11:51
well this compiles for me:
public class QuickBenchmarkTaskAttribute : BenchmarkTaskAttribute
    {
        public QuickBenchmarkTaskAttribute() 
            : base(mode: BenchmarkMode.SingleRun, processCount: 1, warmupIterationCount: 1, targetIterationCount: 1)
        { }
    }
Tommy Long
@smudge202
Dec 01 2015 11:51
I don't think it will be discovered
Because the GetCustomAttributes call linked above states false for allow inheritance
Matt Warren
@mattwarren
Dec 01 2015 11:52
and
    [QuickBenchmarkTask]
    public class PerformanceUnitTest
Tommy Long
@smudge202
Dec 01 2015 11:52
https://msdn.microsoft.com/en-us/library/ms130871(v=vs.110).aspx <= we need to set inherit: true to discover derived attributes I believe
Matt Warren
@mattwarren
Dec 01 2015 11:53
that's a good point about GetCustomAttributes, I haven't actually run the test yet¬
Tommy Long
@smudge202
Dec 01 2015 11:54
I can't see a reason not to set it to true to be honest
I believe the code that's there will still work
Installing VS2015 U1 so can't check in VS, and too lazy to update VSCode... sorry. :)
Tommy Long
@smudge202
Dec 01 2015 11:59
I'm going to create an associated bug. Either BenchmarkAttribute should be sealed or the GetCustomAttributes call should allow inheritance. The combination we have right now I consider to be a bug. Obviously, changing the call instead of sealing the attribute would be a better fix.
Matt Warren
@mattwarren
Dec 01 2015 12:00
sounds good
Tommy Long
@smudge202
Dec 01 2015 12:04
PerfDotNet/BenchmarkDotNet#57
Matt Warren
@mattwarren
Dec 01 2015 12:06

wierdly enough

[QuickBenchmarkTask]
public class PerformanceUnitTest()

works for me, but I'll look into it a bit more when I get round to the issue (there's a bit of a backlog building up :-))

Tommy Long
@smudge202
Dec 01 2015 12:06
Oh... was I wrong then? It does discover inherited attributes?
Matt Warren
@mattwarren
Dec 01 2015 12:07
not really sure at the moment, maybe, maybe not!
Tommy Long
@smudge202
Dec 01 2015 12:07
lol