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
1ce3088d
Commit
1ce3088d
authored
Dec 04, 2014
by
Ovan Crone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding Susanoo to benchmarks
parent
c840cc2e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
4 deletions
+57
-4
Dapper.sln
Dapper.sln
+5
-2
DapperTests NET40.csproj
Tests/DapperTests NET40.csproj
+4
-0
PerformanceTests.cs
Tests/PerformanceTests.cs
+48
-2
No files found.
Dapper.sln
View file @
1ce3088d
Microsoft Visual Studio Solution File, Format Version 12.00
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio
14
# Visual Studio
2013
VisualStudioVersion = 1
4.0.22013.1
VisualStudioVersion = 1
2.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DapperTests NET40", "Tests\DapperTests NET40.csproj", "{A2A80512-11F4-4028-A995-505463632C84}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DapperTests NET40", "Tests\DapperTests NET40.csproj", "{A2A80512-11F4-4028-A995-505463632C84}"
EndProject
EndProject
...
@@ -273,4 +273,7 @@ Global
...
@@ -273,4 +273,7 @@ Global
GlobalSection(SolutionProperties) = preSolution
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
HideSolutionNode = FALSE
EndGlobalSection
EndGlobalSection
GlobalSection(Performance) = preSolution
HasPerformanceSessions = true
EndGlobalSection
EndGlobal
EndGlobal
Tests/DapperTests NET40.csproj
View file @
1ce3088d
...
@@ -140,6 +140,10 @@
...
@@ -140,6 +140,10 @@
<Reference
Include=
"SubSonic.Core"
>
<Reference
Include=
"SubSonic.Core"
>
<HintPath>
SubSonic\SubSonic.Core.dll
</HintPath>
<HintPath>
SubSonic\SubSonic.Core.dll
</HintPath>
</Reference>
</Reference>
<Reference
Include=
"Susanoo.Core, Version=0.5.2.0, Culture=neutral, PublicKeyToken=0a505ce04f8a59d5, processorArchitecture=MSIL"
>
<SpecificVersion>
False
</SpecificVersion>
<HintPath>
..\packages\Susanoo.Core.0.5.2.6\lib\net45\Susanoo.Core.dll
</HintPath>
</Reference>
<Reference
Include=
"System"
/>
<Reference
Include=
"System"
/>
<Reference
Include=
"System.ComponentModel.DataAnnotations"
/>
<Reference
Include=
"System.ComponentModel.DataAnnotations"
/>
<Reference
Include=
"System.configuration"
/>
<Reference
Include=
"System.configuration"
/>
...
...
Tests/PerformanceTests.cs
View file @
1ce3088d
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
using
SqlMapper.NHibernate
;
using
SqlMapper.NHibernate
;
using
Dapper.Contrib.Extensions
;
using
Dapper.Contrib.Extensions
;
using
SqlMapper.EntityFramework
;
using
SqlMapper.EntityFramework
;
using
Susanoo
;
namespace
SqlMapper
namespace
SqlMapper
{
{
...
@@ -137,7 +138,7 @@ public void Run(int iterations)
...
@@ -137,7 +138,7 @@ public void Run(int iterations)
// PetaPoco test with all default options
// PetaPoco test with all default options
var
petapoco
=
new
PetaPoco
.
Database
(
Program
.
ConnectionString
,
"System.Data.SqlClient"
);
var
petapoco
=
new
PetaPoco
.
Database
(
Program
.
ConnectionString
,
"System.Data.SqlClient"
);
petapoco
.
OpenSharedConnection
();
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
// PetaPoco with some "smart" functionality disabled
var
petapocoFast
=
new
PetaPoco
.
Database
(
Program
.
ConnectionString
,
"System.Data.SqlClient"
);
var
petapocoFast
=
new
PetaPoco
.
Database
(
Program
.
ConnectionString
,
"System.Data.SqlClient"
);
...
@@ -145,7 +146,7 @@ public void Run(int iterations)
...
@@ -145,7 +146,7 @@ public void Run(int iterations)
petapocoFast
.
EnableAutoSelect
=
false
;
petapocoFast
.
EnableAutoSelect
=
false
;
petapocoFast
.
EnableNamedParams
=
false
;
petapocoFast
.
EnableNamedParams
=
false
;
petapocoFast
.
ForceDateTimesToUtc
=
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
// Subsonic ActiveRecord
tests
.
Add
(
id
=>
SubSonic
.
Post
.
SingleOrDefault
(
x
=>
x
.
Id
==
id
),
"SubSonic ActiveRecord.SingleOrDefault"
);
tests
.
Add
(
id
=>
SubSonic
.
Post
.
SingleOrDefault
(
x
=>
x
.
Id
==
id
),
"SubSonic ActiveRecord.SingleOrDefault"
);
...
@@ -187,6 +188,40 @@ public void Run(int iterations)
...
@@ -187,6 +188,40 @@ public void Run(int iterations)
var
sdb
=
Simple
.
Data
.
Database
.
OpenConnection
(
Program
.
ConnectionString
);
var
sdb
=
Simple
.
Data
.
Database
.
OpenConnection
(
Program
.
ConnectionString
);
tests
.
Add
(
id
=>
sdb
.
Posts
.
FindById
(
id
),
"Simple.Data"
);
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
// Soma
var
somadb
=
new
Soma
.
Core
.
Db
(
new
SomaConfig
());
var
somadb
=
new
Soma
.
Core
.
Db
(
new
SomaConfig
());
tests
.
Add
(
id
=>
somadb
.
Find
<
Post
>(
id
),
"Soma"
);
tests
.
Add
(
id
=>
somadb
.
Find
<
Post
>(
id
),
"Soma"
);
...
@@ -288,4 +323,15 @@ public static string GetNullableString(this SqlDataReader reader, int index)
...
@@ -288,4 +323,15 @@ public static string GetNullableString(this SqlDataReader reader, int index)
return
null
;
return
null
;
}
}
}
}
public
class
TestSusanooDatabaseMananger
:
Susanoo
.
DatabaseManager
{
public
TestSusanooDatabaseMananger
(
string
connectionStringName
)
:
base
(
connectionStringName
)
{
this
.
OpenConnection
();
}
}
}
}
\ 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