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
9ab09f9b
Commit
9ab09f9b
authored
Mar 18, 2015
by
Marc Gravell
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #217 from psibernetic/SusanooBenchmarks
Adding Susanoo benchmarks
parents
2f4119f0
483d393e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
4 deletions
+47
-4
Dapper.sln
Dapper.sln
+5
-2
DapperTests NET40.csproj
Tests/DapperTests NET40.csproj
+4
-0
PerformanceTests.cs
Tests/PerformanceTests.cs
+37
-2
packages.config
Tests/packages.config
+1
-0
No files found.
Dapper.sln
View file @
9ab09f9b
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio
14
VisualStudioVersion = 1
4.0.22013.1
# Visual Studio
2013
VisualStudioVersion = 1
2.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DapperTests NET40", "Tests\DapperTests NET40.csproj", "{A2A80512-11F4-4028-A995-505463632C84}"
EndProject
...
...
@@ -273,4 +273,7 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(Performance) = preSolution
HasPerformanceSessions = true
EndGlobalSection
EndGlobal
Tests/DapperTests NET40.csproj
View file @
9ab09f9b
...
...
@@ -140,6 +140,10 @@
<Reference
Include=
"SubSonic.Core"
>
<HintPath>
SubSonic\SubSonic.Core.dll
</HintPath>
</Reference>
<Reference
Include=
"Susanoo.Core, Version=0.5.3.0, Culture=neutral, PublicKeyToken=0a505ce04f8a59d5, processorArchitecture=MSIL"
>
<SpecificVersion>
False
</SpecificVersion>
<HintPath>
..\packages\Susanoo.Core.0.5.3.0\lib\net45\Susanoo.Core.dll
</HintPath>
</Reference>
<Reference
Include=
"System"
/>
<Reference
Include=
"System.ComponentModel.DataAnnotations"
/>
<Reference
Include=
"System.configuration"
/>
...
...
Tests/PerformanceTests.cs
View file @
9ab09f9b
...
...
@@ -16,6 +16,7 @@
using
SqlMapper.NHibernate
;
using
Dapper.Contrib.Extensions
;
using
SqlMapper.EntityFramework
;
using
Susanoo
;
namespace
SqlMapper
{
...
...
@@ -137,7 +138,7 @@ public void Run(int iterations)
// PetaPoco test with all default options
var
petapoco
=
new
PetaPoco
.
Database
(
Program
.
ConnectionString
,
"System.Data.SqlClient"
);
petapoco
.
OpenSharedConnection
();
tests
.
Add
(
id
=>
petapoco
.
Fetch
<
Post
>(
"SELECT * from Posts where Id=@0"
,
id
),
"PetaPoco (Normal)"
);
tests
.
Add
(
id
=>
petapoco
.
Fetch
<
Post
>(
"SELECT * from Posts where Id=@0"
,
id
)
.
First
()
,
"PetaPoco (Normal)"
);
// PetaPoco with some "smart" functionality disabled
var
petapocoFast
=
new
PetaPoco
.
Database
(
Program
.
ConnectionString
,
"System.Data.SqlClient"
);
...
...
@@ -145,7 +146,7 @@ public void Run(int iterations)
petapocoFast
.
EnableAutoSelect
=
false
;
petapocoFast
.
EnableNamedParams
=
false
;
petapocoFast
.
ForceDateTimesToUtc
=
false
;
tests
.
Add
(
id
=>
petapocoFast
.
Fetch
<
Post
>(
"SELECT * from Posts where Id=@0"
,
id
),
"PetaPoco (Fast)"
);
tests
.
Add
(
id
=>
petapocoFast
.
Fetch
<
Post
>(
"SELECT * from Posts where Id=@0"
,
id
)
.
First
()
,
"PetaPoco (Fast)"
);
// Subsonic ActiveRecord
tests
.
Add
(
id
=>
SubSonic
.
Post
.
SingleOrDefault
(
x
=>
x
.
Id
==
id
),
"SubSonic ActiveRecord.SingleOrDefault"
);
...
...
@@ -187,6 +188,40 @@ public void Run(int iterations)
var
sdb
=
Simple
.
Data
.
Database
.
OpenConnection
(
Program
.
ConnectionString
);
tests
.
Add
(
id
=>
sdb
.
Posts
.
FindById
(
id
),
"Simple.Data"
);
//Susanoo
var
susanooDb
=
new
DatabaseManager
(
"Smackdown.Properties.Settings.tempdbConnectionString"
);
var
susanooDb2
=
new
DatabaseManager
(
"Smackdown.Properties.Settings.tempdbConnectionString"
);
var
susanooPreDefinedCommand
=
CommandManager
.
DefineCommand
(
"SELECT * FROM Posts WHERE Id = @Id"
,
CommandType
.
Text
)
.
DefineResults
<
Post
>()
.
Realize
(
"PostById"
);
var
susanooDynamicPreDefinedCommand
=
CommandManager
.
DefineCommand
(
"SELECT * FROM Posts WHERE Id = @Id"
,
CommandType
.
Text
)
.
DefineResults
<
dynamic
>()
.
Realize
(
"DynamicById"
);
tests
.
Add
(
Id
=>
CommandManager
.
DefineCommand
(
"SELECT * FROM Posts WHERE Id = @Id"
,
CommandType
.
Text
)
.
DefineResults
<
Post
>()
.
Realize
(
"PostById"
)
.
Execute
(
susanooDb
,
new
{
Id
}).
First
(),
"Susanoo Mapping Cache Retrieval"
);
tests
.
Add
(
Id
=>
CommandManager
.
DefineCommand
(
"SELECT * FROM Posts WHERE Id = @Id"
,
CommandType
.
Text
)
.
DefineResults
<
dynamic
>()
.
Realize
(
"DynamicById"
)
.
Execute
(
susanooDb
,
new
{
Id
}).
First
(),
"Susanoo Dynamic Mapping Cache Retrieval"
);
tests
.
Add
(
Id
=>
susanooDynamicPreDefinedCommand
.
Execute
(
susanooDb
,
new
{
Id
}).
First
(),
"Susanoo Dynamic Mapping Static"
);
tests
.
Add
(
Id
=>
susanooPreDefinedCommand
.
Execute
(
susanooDb
,
new
{
Id
}).
First
(),
"Susanoo Mapping Static"
);
// Soma
var
somadb
=
new
Soma
.
Core
.
Db
(
new
SomaConfig
());
tests
.
Add
(
id
=>
somadb
.
Find
<
Post
>(
id
),
"Soma"
);
...
...
Tests/packages.config
View file @
9ab09f9b
...
...
@@ -12,4 +12,5 @@
<
package
id
=
"Microsoft.SqlServer.Types"
version
=
"11.0.1"
targetFramework
=
"net45"
/>
<
package
id
=
"Npgsql"
version
=
"2.2.1"
targetFramework
=
"net45"
/>
<
package
id
=
"SqlServerCompact"
version
=
"4.0.8854.1"
targetFramework
=
"net45"
/>
<
package
id
=
"Susanoo.Core"
version
=
"0.5.3.0"
targetFramework
=
"net45"
/>
</
packages
>
\ No newline at end of file
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