diff --git a/test/Hyperbee.Expressions.Benchmark/AsyncBenchmarks.cs b/test/Hyperbee.Expressions.Benchmark/AsyncBenchmarks.cs index 0b02d57..92f8577 100644 --- a/test/Hyperbee.Expressions.Benchmark/AsyncBenchmarks.cs +++ b/test/Hyperbee.Expressions.Benchmark/AsyncBenchmarks.cs @@ -10,18 +10,11 @@ namespace Hyperbee.Expressions.Benchmark; public class AsyncBenchmarks { - private const int IterationCount = 100; - private Func> _preRunCompiled = null!; private Func> _preRunFastCompiled = null!; private Func> _preRunNextCompiled = null!; //private Func> _preRunNextFastCompiled = null!; - private Func> _coldRunCompiled = null!; - private Func> _coldRunFastCompiled = null!; - private Func> _coldRunNextCompiled = null!; - //private Func> _coldRunNextFastCompiled = null!; - private Expression>> _lambda = null!; private Expression>> _nextlambda = null!; @@ -47,7 +40,7 @@ public void Setup() _lambda = Lambda>>( _expression ); - _nextlambda = CodeGenerator.AsyncLambda>>( ( fun, result ) => + _nextlambda = CodeGenerator.AsyncLambda>>( ( _, result ) => { var isTrue = CodeGenerator.DeclareVariable( "isTrue", typeof( bool ).New() ); @@ -93,19 +86,6 @@ void Warmup( params Func>[] funcs ) } } - [IterationSetup( Targets = [ - nameof(Hyperbee_AsyncBlock_FirstExecute), - nameof(Hyperbee_AsyncBlock_FirstFastExecute), - nameof(DotNext_AsyncLambda_FirstExecute) - ] )] - public void IterationSetup() - { - _coldRunCompiled = _lambda.Compile(); - _coldRunFastCompiled = _lambda.CompileFast(); - _coldRunNextCompiled = _nextlambda.Compile(); - //_coldRunNextFastCompiled = _nextlambda.CompileFast(); - } - // Compile [BenchmarkCategory( "Compile" )] @@ -129,32 +109,6 @@ public void DotNext_AsyncLambda_Compile() _nextlambda.Compile(); } - // First Execute - - [BenchmarkCategory( "First Execute" )] - [Benchmark( Description = "Hyperbee First Execute" )] - [InvocationCount( invocationCount: IterationCount, unrollFactor: 1 )] - public async Task Hyperbee_AsyncBlock_FirstExecute() - { - await _coldRunCompiled(); - } - - [BenchmarkCategory( "First Execute" )] - [Benchmark( Description = "Hyperbee First Fast Execute" )] - [InvocationCount( invocationCount: IterationCount, unrollFactor: 1 )] - public async Task Hyperbee_AsyncBlock_FirstFastExecute() - { - await _coldRunFastCompiled(); - } - - [BenchmarkCategory( "First Execute" )] - [Benchmark( Description = "DotNext First Execute" )] - [InvocationCount( invocationCount: IterationCount, unrollFactor: 1 )] - public async Task DotNext_AsyncLambda_FirstExecute() - { - await _coldRunNextCompiled(); - } - // Execute [BenchmarkCategory( "Execute" )]