Abstract distribution model
This commit is contained in:
1 parent
c29db73a0e
commit
b409e5ef08
6 files changed
+120
-16
No files matched your search
@@ -0,0 +1,30 @@
|
||||
using BenchmarkDotNet.Attributes;
|
||||
|
||||
namespace mROA.Benchmark;
|
||||
|
||||
[MemoryDiagnoser]
|
||||
[DisassemblyDiagnoser]
|
||||
public class InvokePerformance
|
||||
{
|
||||
public Func<int, int> A = x =>
|
||||
{
|
||||
var result = x * 5 + x * x / 5;
|
||||
return result;
|
||||
};
|
||||
|
||||
public SomeMath B = x => x * 5 + x * x / 5;
|
||||
|
||||
[Benchmark(Baseline = true)]
|
||||
public int ActionInvoke()
|
||||
{
|
||||
return A(132);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
public int DelegateInvoke()
|
||||
{
|
||||
return A(132);
|
||||
}
|
||||
}
|
||||
|
||||
public delegate int SomeMath(int x);
|
||||
@@ -5,4 +5,4 @@ using mROA.Benchmark;
|
||||
|
||||
Console.WriteLine("Hello, World!");
|
||||
|
||||
BenchmarkRunner.Run<TaskWaiting>();
|
||||
BenchmarkRunner.Run<InvokePerformance>();
|
||||
Reference in new issue
Block a user