diff --git a/Dapper.Tests.Performance/Benchmarks.Dashing.cs b/Dapper.Tests.Performance/Benchmarks.Dashing.cs new file mode 100644 index 00000000..1c9be9d1 --- /dev/null +++ b/Dapper.Tests.Performance/Benchmarks.Dashing.cs @@ -0,0 +1,27 @@ +using BenchmarkDotNet.Attributes; +using Dapper.Tests.Performance.Dashing; +using Dashing; + +namespace Dapper.Tests.Performance +{ + public class DashingBenchmarks : BenchmarkBase + { + private ISession session; + + [GlobalSetup] + public void Setup() + { + BaseSetup(); + var configuration = new DashingConfiguration(); + var database = new SqlDatabase(configuration, ConnectionString); + this.session = database.BeginTransactionLessSession(_connection); + } + + [Benchmark(Description = "Get By Id")] + public Dashing.Post QueryBuffered() + { + Step(); + return session.Get(i); + } + } +} diff --git a/Dapper.Tests.Performance/Dapper.Tests.Performance.csproj b/Dapper.Tests.Performance/Dapper.Tests.Performance.csproj index 83e1a3d7..80ba2b12 100644 --- a/Dapper.Tests.Performance/Dapper.Tests.Performance.csproj +++ b/Dapper.Tests.Performance/Dapper.Tests.Performance.csproj @@ -1,4 +1,5 @@ - + + Dapper.Tests.Performance Dapper.Tests.Performance @@ -11,6 +12,8 @@ + + @@ -45,4 +48,8 @@ + + + -p "$(MSBuildThisFileDirectory)$(OutputPath)$(AssemblyName).exe" -t "Dapper.Tests.Performance.Dashing.DashingConfiguration" + diff --git a/Dapper.Tests.Performance/Dashing/DashingConfiguration.cs b/Dapper.Tests.Performance/Dashing/DashingConfiguration.cs new file mode 100644 index 00000000..29bc6324 --- /dev/null +++ b/Dapper.Tests.Performance/Dashing/DashingConfiguration.cs @@ -0,0 +1,12 @@ +using Dashing.Configuration; + +namespace Dapper.Tests.Performance.Dashing +{ + public class DashingConfiguration : BaseConfiguration + { + public DashingConfiguration() + { + this.Add(); + } + } +} \ No newline at end of file diff --git a/Dapper.Tests.Performance/Dashing/Post.cs b/Dapper.Tests.Performance/Dashing/Post.cs new file mode 100644 index 00000000..e6a253ea --- /dev/null +++ b/Dapper.Tests.Performance/Dashing/Post.cs @@ -0,0 +1,21 @@ +using System; + +namespace Dapper.Tests.Performance.Dashing +{ + public class Post + { + public int Id { get; set; } + public string Text { get; set; } + public DateTime CreationDate { get; set; } + public DateTime LastChangeDate { get; set; } + public int? Counter1 { get; set; } + public int? Counter2 { get; set; } + public int? Counter3 { get; set; } + public int? Counter4 { get; set; } + public int? Counter5 { get; set; } + public int? Counter6 { get; set; } + public int? Counter7 { get; set; } + public int? Counter8 { get; set; } + public int? Counter9 { get; set; } + } +} diff --git a/Dapper.Tests.Performance/LegacyTests.cs b/Dapper.Tests.Performance/LegacyTests.cs index a25aefac..5ca323ea 100644 --- a/Dapper.Tests.Performance/LegacyTests.cs +++ b/Dapper.Tests.Performance/LegacyTests.cs @@ -19,7 +19,9 @@ using ServiceStack.OrmLite.Dapper; using Susanoo; using System.Configuration; using System.Threading.Tasks; +using Dapper.Tests.Performance.Dashing; using Dapper.Tests.Performance.EntityFrameworkCore; +using Dashing; using Microsoft.EntityFrameworkCore; using Belgrade.SqlClient; @@ -186,6 +188,15 @@ namespace Dapper.Tests.Performance tests.Add(id => mapperConnection3.Get(id), "Dapper.Contrib"); }, "Dapper"); + // Dashing + Try(() => + { + var config = new DashingConfiguration(); + var database = new SqlDatabase(config, ConnectionString); + var session = database.BeginTransactionLessSession(GetOpenConnection()); + tests.Add(id => session.Get(id), "Dashing Get"); + }, "Dashing"); + // Massive Try(() => {