-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds Dashing benchmarks to Dapper.Tests.Performance
- Loading branch information
1 parent
5256f2e
commit b262cb3
Showing
5 changed files
with
79 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<Dashing.Post>(i); | ||
} | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using Dashing.Configuration; | ||
|
||
namespace Dapper.Tests.Performance.Dashing | ||
{ | ||
public class DashingConfiguration : BaseConfiguration | ||
{ | ||
public DashingConfiguration() | ||
{ | ||
this.Add<Post>(); | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; } | ||
} | ||
} |
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