diff --git a/Dapper.Tests.Performance/Benchmarks.Belgrade.cs b/Dapper.Tests.Performance/Benchmarks.Belgrade.cs index 3c80d8183..23dc2f8ee 100644 --- a/Dapper.Tests.Performance/Benchmarks.Belgrade.cs +++ b/Dapper.Tests.Performance/Benchmarks.Belgrade.cs @@ -15,7 +15,7 @@ public void Setup() _mapper = new QueryMapper(ConnectionString); } - [Benchmark(Description = "ExecuteReader", OperationsPerInvoke = Iterations)] + [Benchmark(Description = "ExecuteReader")] public async Task ExecuteReader() { Step(); diff --git a/Dapper.Tests.Performance/Benchmarks.Dapper.cs b/Dapper.Tests.Performance/Benchmarks.Dapper.cs index 3fb0df127..24dafb5e4 100644 --- a/Dapper.Tests.Performance/Benchmarks.Dapper.cs +++ b/Dapper.Tests.Performance/Benchmarks.Dapper.cs @@ -12,46 +12,46 @@ public void Setup() BaseSetup(); } - [Benchmark(Description = "Query (buffered)", OperationsPerInvoke = Iterations)] + [Benchmark(Description = "Query (buffered)")] public Post QueryBuffered() { Step(); return _connection.Query("select * from Posts where Id = @Id", new { Id = i }, buffered: true).First(); } - [Benchmark(Description = "Query (buffered)", OperationsPerInvoke = Iterations)] + [Benchmark(Description = "Query (buffered)")] public dynamic QueryBufferedDynamic() { Step(); return _connection.Query("select * from Posts where Id = @Id", new { Id = i }, buffered: true).First(); } - [Benchmark(Description = "Query (unbuffered)", OperationsPerInvoke = Iterations)] + [Benchmark(Description = "Query (unbuffered)")] public Post QueryUnbuffered() { Step(); return _connection.Query("select * from Posts where Id = @Id", new { Id = i }, buffered: false).First(); } - [Benchmark(Description = "Query (unbuffered)", OperationsPerInvoke = Iterations)] + [Benchmark(Description = "Query (unbuffered)")] public dynamic QueryUnbufferedDynamic() { Step(); return _connection.Query("select * from Posts where Id = @Id", new { Id = i }, buffered: false).First(); } - [Benchmark(Description = "QueryFirstOrDefault", OperationsPerInvoke = Iterations)] + [Benchmark(Description = "QueryFirstOrDefault")] public Post QueryFirstOrDefault() { Step(); return _connection.QueryFirstOrDefault("select * from Posts where Id = @Id", new { Id = i }); } - [Benchmark(Description = "QueryFirstOrDefault", OperationsPerInvoke = Iterations)] + [Benchmark(Description = "QueryFirstOrDefault")] public dynamic QueryFirstOrDefaultDynamic() { Step(); return _connection.QueryFirstOrDefault("select * from Posts where Id = @Id", new { Id = i }).First(); } - [Benchmark(Description = "Contrib Get", OperationsPerInvoke = Iterations)] + [Benchmark(Description = "Contrib Get")] public Post ContribGet() { Step(); diff --git a/Dapper.Tests.Performance/Benchmarks.EntityFramework.cs b/Dapper.Tests.Performance/Benchmarks.EntityFramework.cs index 0898be186..dd01c670d 100644 --- a/Dapper.Tests.Performance/Benchmarks.EntityFramework.cs +++ b/Dapper.Tests.Performance/Benchmarks.EntityFramework.cs @@ -19,21 +19,21 @@ public void Setup() Context = new EntityFramework.EFContext(_connection); } - [Benchmark(Description = "Normal", OperationsPerInvoke = Iterations)] + [Benchmark(Description = "Normal")] public Post Normal() { Step(); return Context.Posts.First(p => p.Id == i); } - [Benchmark(Description = "SqlQuery", OperationsPerInvoke = Iterations)] + [Benchmark(Description = "SqlQuery")] public Post SqlQuery() { Step(); return Context.Database.SqlQuery("select * from Posts where Id = {0}", i).First(); } - [Benchmark(Description = "No Tracking", OperationsPerInvoke = Iterations)] + [Benchmark(Description = "No Tracking")] public Post NoTracking() { Step(); diff --git a/Dapper.Tests.Performance/Benchmarks.HandCoded.cs b/Dapper.Tests.Performance/Benchmarks.HandCoded.cs index 96b14f5db..a02b970a9 100644 --- a/Dapper.Tests.Performance/Benchmarks.HandCoded.cs +++ b/Dapper.Tests.Performance/Benchmarks.HandCoded.cs @@ -47,7 +47,7 @@ public void Setup() #endif } - [Benchmark(Description = "SqlCommand", OperationsPerInvoke = Iterations, Baseline = true)] + [Benchmark(Description = "SqlCommand", Baseline = true)] public Post SqlCommand() { Step(); @@ -75,7 +75,7 @@ public Post SqlCommand() } } - [Benchmark(Description = "DataTable", OperationsPerInvoke = Iterations)] + [Benchmark(Description = "DataTable")] public dynamic DataTableDynamic() { Step(); diff --git a/Dapper.Tests.Performance/Benchmarks.Linq2Sql.cs b/Dapper.Tests.Performance/Benchmarks.Linq2Sql.cs index bea4ff451..e32495e4f 100644 --- a/Dapper.Tests.Performance/Benchmarks.Linq2Sql.cs +++ b/Dapper.Tests.Performance/Benchmarks.Linq2Sql.cs @@ -19,21 +19,21 @@ public void Setup() Linq2SqlContext = new DataClassesDataContext(_connection); } - [Benchmark(Description = "Normal", OperationsPerInvoke = Iterations)] + [Benchmark(Description = "Normal")] public Linq2Sql.Post Normal() { Step(); return Linq2SqlContext.Posts.First(p => p.Id == i); } - [Benchmark(Description = "Compiled", OperationsPerInvoke = Iterations)] + [Benchmark(Description = "Compiled")] public Linq2Sql.Post Compiled() { Step(); return compiledQuery(Linq2SqlContext, i); } - [Benchmark(Description = "ExecuteQuery", OperationsPerInvoke = Iterations)] + [Benchmark(Description = "ExecuteQuery")] public Post ExecuteQuery() { Step(); diff --git a/Dapper.Tests.Performance/Benchmarks.Massive.cs b/Dapper.Tests.Performance/Benchmarks.Massive.cs index 83967869b..395fb92d5 100644 --- a/Dapper.Tests.Performance/Benchmarks.Massive.cs +++ b/Dapper.Tests.Performance/Benchmarks.Massive.cs @@ -15,7 +15,7 @@ public void Setup() _model = new DynamicModel(ConnectionString); } - [Benchmark(Description = "Query (dynamic)", OperationsPerInvoke = Iterations)] + [Benchmark(Description = "Query (dynamic)")] public dynamic QueryDynamic() { Step(); diff --git a/Dapper.Tests.Performance/Benchmarks.NHibernate.cs b/Dapper.Tests.Performance/Benchmarks.NHibernate.cs index ca6a9b64d..687440ec2 100644 --- a/Dapper.Tests.Performance/Benchmarks.NHibernate.cs +++ b/Dapper.Tests.Performance/Benchmarks.NHibernate.cs @@ -24,7 +24,7 @@ public void Setup() _get = NHibernateHelper.OpenSession(); } - [Benchmark(Description = "SQL", OperationsPerInvoke = Iterations)] + [Benchmark(Description = "SQL")] public Post SQL() { Step(); @@ -34,7 +34,7 @@ public Post SQL() .List()[0]; } - [Benchmark(Description = "HQL", OperationsPerInvoke = Iterations)] + [Benchmark(Description = "HQL")] public Post HQL() { Step(); @@ -43,7 +43,7 @@ public Post HQL() .List()[0]; } - [Benchmark(Description = "Criteria", OperationsPerInvoke = Iterations)] + [Benchmark(Description = "Criteria")] public Post Criteria() { Step(); @@ -52,14 +52,14 @@ public Post Criteria() .List()[0]; } - [Benchmark(Description = "LINQ", OperationsPerInvoke = Iterations)] + [Benchmark(Description = "LINQ")] public Post LINQ() { Step(); return _linq.Query().First(p => p.Id == i); } - [Benchmark(Description = "Get", OperationsPerInvoke = Iterations)] + [Benchmark(Description = "Get")] public Post Get() { Step(); diff --git a/Dapper.Tests.Performance/Benchmarks.PetaPoco.cs b/Dapper.Tests.Performance/Benchmarks.PetaPoco.cs index 1fce2ebe8..a660713d7 100644 --- a/Dapper.Tests.Performance/Benchmarks.PetaPoco.cs +++ b/Dapper.Tests.Performance/Benchmarks.PetaPoco.cs @@ -21,14 +21,14 @@ public void Setup() _dbFast.ForceDateTimesToUtc = false; } - [Benchmark(Description = "Fetch", OperationsPerInvoke = Iterations)] + [Benchmark(Description = "Fetch")] public Post Fetch() { Step(); return _db.Fetch("SELECT * from Posts where Id=@0", i).First(); } - [Benchmark(Description = "Fetch (Fast)", OperationsPerInvoke = Iterations)] + [Benchmark(Description = "Fetch (Fast)")] public Post FetchFast() { Step(); diff --git a/Dapper.Tests.Performance/Benchmarks.ServiceStack.cs b/Dapper.Tests.Performance/Benchmarks.ServiceStack.cs index 442b06b2b..a7b56bb2d 100644 --- a/Dapper.Tests.Performance/Benchmarks.ServiceStack.cs +++ b/Dapper.Tests.Performance/Benchmarks.ServiceStack.cs @@ -16,7 +16,7 @@ public void Setup() _db = dbFactory.Open(); } - [Benchmark(Description = "SingleById", OperationsPerInvoke = Iterations)] + [Benchmark(Description = "SingleById")] public Post Query() { Step(); diff --git a/Dapper.Tests.Performance/Benchmarks.Soma.cs b/Dapper.Tests.Performance/Benchmarks.Soma.cs index 9c388f928..83efb2931 100644 --- a/Dapper.Tests.Performance/Benchmarks.Soma.cs +++ b/Dapper.Tests.Performance/Benchmarks.Soma.cs @@ -13,7 +13,7 @@ public void Setup() _sdb = Simple.Data.Database.OpenConnection(ConnectionString); } - [Benchmark(Description = "FindById", OperationsPerInvoke = Iterations)] + [Benchmark(Description = "FindById")] public dynamic QueryDynamic() { Step(); diff --git a/Dapper.Tests.Performance/Benchmarks.Susanoo.cs b/Dapper.Tests.Performance/Benchmarks.Susanoo.cs index aead42be0..ec56d4253 100644 --- a/Dapper.Tests.Performance/Benchmarks.Susanoo.cs +++ b/Dapper.Tests.Performance/Benchmarks.Susanoo.cs @@ -25,7 +25,7 @@ public void Setup() _db = new DatabaseManager(_connection); } - [Benchmark(Description = "Mapping Cache", OperationsPerInvoke = Iterations)] + [Benchmark(Description = "Mapping Cache")] public Post MappingCache() { Step(); @@ -35,7 +35,7 @@ public Post MappingCache() .Execute(_db, new { Id = i }).First(); } - [Benchmark(Description = "Mapping Cache (dynamic)", OperationsPerInvoke = Iterations)] + [Benchmark(Description = "Mapping Cache (dynamic)")] public dynamic MappingCacheDynamic() { Step(); @@ -45,14 +45,14 @@ public dynamic MappingCacheDynamic() .Execute(_db, new { Id = i }).First(); } - [Benchmark(Description = "Mapping Static", OperationsPerInvoke = Iterations)] + [Benchmark(Description = "Mapping Static")] public Post MappingStatic() { Step(); return _cmd.Execute(_db, new { Id = i }).First(); } - [Benchmark(Description = "Mapping Static (dynamic)", OperationsPerInvoke = Iterations)] + [Benchmark(Description = "Mapping Static (dynamic)")] public dynamic MappingStaticDynamic() { Step(); diff --git a/Dapper.Tests.Performance/Benchmarks.cs b/Dapper.Tests.Performance/Benchmarks.cs index 1467c6aeb..9518318aa 100644 --- a/Dapper.Tests.Performance/Benchmarks.cs +++ b/Dapper.Tests.Performance/Benchmarks.cs @@ -46,10 +46,12 @@ public Config() Add(new ORMColum()); Add(new ReturnColum()); Add(Job.Default + .WithUnrollFactor(BenchmarkBase.Iterations) + //.WithIterationTime(new TimeInterval(500, TimeUnit.Millisecond)) .WithLaunchCount(1) - .WithIterationTime(new TimeInterval(500, TimeUnit.Millisecond)) - .WithWarmupCount(3) - .WithTargetCount(3) + .WithWarmupCount(0) + .WithTargetCount(5) + .WithRemoveOutliers(true) ); } }