Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
Dapper
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
Dapper
Commits
b262cb33
Commit
b262cb33
authored
Sep 11, 2018
by
markjerz
Committed by
Nick Craver
Sep 11, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Dashing Benchmarks (#1126)
Adds Dashing benchmarks to Dapper.Tests.Performance
parent
5256f2ea
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
79 additions
and
1 deletion
+79
-1
Benchmarks.Dashing.cs
Dapper.Tests.Performance/Benchmarks.Dashing.cs
+27
-0
Dapper.Tests.Performance.csproj
Dapper.Tests.Performance/Dapper.Tests.Performance.csproj
+8
-1
DashingConfiguration.cs
Dapper.Tests.Performance/Dashing/DashingConfiguration.cs
+12
-0
Post.cs
Dapper.Tests.Performance/Dashing/Post.cs
+21
-0
LegacyTests.cs
Dapper.Tests.Performance/LegacyTests.cs
+11
-0
No files found.
Dapper.Tests.Performance/Benchmarks.Dashing.cs
0 → 100644
View file @
b262cb33
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
);
}
}
}
Dapper.Tests.Performance/Dapper.Tests.Performance.csproj
View file @
b262cb33
<Project Sdk="Microsoft.NET.Sdk">
<Project>
<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.props" />
<PropertyGroup>
<AssemblyName>Dapper.Tests.Performance</AssemblyName>
<Title>Dapper.Tests.Performance</Title>
...
...
@@ -11,6 +12,8 @@
<ProjectReference Include="..\Dapper\Dapper.csproj" />
<ProjectReference Include="..\Dapper.Contrib\Dapper.Contrib.csproj" />
<ProjectReference Include="..\Dapper.EntityFramework\Dapper.EntityFramework.csproj" />
<PackageReference Include="Dashing" Version="2.0.7" />
<PackageReference Include="Dashing.Weaver" Version="2.0.7" />
<PackageReference Include="Belgrade.Sql.Client" Version="1.1.4" />
<PackageReference Include="BenchmarkDotNet" Version="0.11.1" />
<!--<PackageReference Include="BLToolkit" Version="4.3.6" />-->
...
...
@@ -45,4 +48,8 @@
<ItemGroup>
<PackageReference Update="SourceLink.Create.GitHub" Version="2.8.3" />
</ItemGroup>
<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.targets" />
<PropertyGroup>
<WeaveArguments>-p "$(MSBuildThisFileDirectory)$(OutputPath)$(AssemblyName).exe" -t "Dapper.Tests.Performance.Dashing.DashingConfiguration"</WeaveArguments>
</PropertyGroup>
</Project>
Dapper.Tests.Performance/Dashing/DashingConfiguration.cs
0 → 100644
View file @
b262cb33
using
Dashing.Configuration
;
namespace
Dapper.Tests.Performance.Dashing
{
public
class
DashingConfiguration
:
BaseConfiguration
{
public
DashingConfiguration
()
{
this
.
Add
<
Post
>();
}
}
}
\ No newline at end of file
Dapper.Tests.Performance/Dashing/Post.cs
0 → 100644
View file @
b262cb33
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
;
}
}
}
Dapper.Tests.Performance/LegacyTests.cs
View file @
b262cb33
...
...
@@ -19,7 +19,9 @@
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 @@ public async Task RunAsync(int iterations)
tests
.
Add
(
id
=>
mapperConnection3
.
Get
<
Post
>(
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
<
Dashing
.
Post
>(
id
),
"Dashing Get"
);
},
"Dashing"
);
// Massive
Try
(()
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment