Created
June 26, 2022 11:36
-
-
Save AhmedTarekHasan/1184e49cb181cc5a82804ccacdd6c686 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Running; | |
namespace Benchmarking | |
{ | |
public class Program | |
{ | |
static void Main(string[] args) | |
{ | |
BenchmarkRunner.Run<MemoryBenchmarker>(); | |
} | |
} | |
[MemoryDiagnoser] | |
[RankColumn] | |
public class MemoryBenchmarker | |
{ | |
[Benchmark] | |
public decimal RunTemplateMethodPattern() | |
{ | |
return TemplateMethodPattern.Program.Run(); | |
} | |
[Benchmark] | |
public decimal RunTemplateMethodPatternWithProperties() | |
{ | |
return TemplateMethodPatternWithProperties.Program.Run(); | |
} | |
[Benchmark] | |
public decimal RunTemplateMethodPatternWithFlaggedEnums() | |
{ | |
return TemplateMethodPatternWithFlaggedEnums.Program.Run(); | |
} | |
[Benchmark] | |
public decimal RunTemplateMethodPatternWithInterfaces() | |
{ | |
return TemplateMethodPatternWithInterfaces.Program.Run(); | |
} | |
[Benchmark] | |
public decimal RunTemplateMethodPatternWithGeneratedExpressionUsingProperties() | |
{ | |
return TemplateMethodPatternWithGeneratedExpressionUsingProperties.Program.Run(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment