Commit c1319217 authored by andrex's avatar andrex

Added benchmarks for bltoolkit

parent 7535cb7d
/*.suo /*.suo
bin/* bin/*
obj/* obj/*
\ No newline at end of file /*.user
\ No newline at end of file
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text;
using System.Data.SqlClient; using System.Data.SqlClient;
using BLToolkit.Data;
using SqlMapper.Linq2Sql; using SqlMapper.Linq2Sql;
using System.Data.Linq; using System.Data.Linq;
using System.Diagnostics; using System.Diagnostics;
...@@ -13,7 +13,6 @@ namespace SqlMapper ...@@ -13,7 +13,6 @@ namespace SqlMapper
{ {
class PerformanceTests class PerformanceTests
{ {
class Test class Test
{ {
public static Test Create(Action<int> iteration, string name) public static Test Create(Action<int> iteration, string name)
...@@ -126,12 +125,14 @@ public void Run(int iterations) ...@@ -126,12 +125,14 @@ public void Run(int iterations)
.SetInt32("id", id) .SetInt32("id", id)
.List(), "NHibernate SQL"); .List(), "NHibernate SQL");
var nhSession2 = NHibernateHelper.OpenSession(); var nhSession2 = NHibernateHelper.OpenSession();
tests.Add(id => nhSession2.CreateQuery(@"from Post as p where p.Id = :id") tests.Add(id => nhSession2.CreateQuery(@"from Post as p where p.Id = :id")
.SetInt32("id", id) .SetInt32("id", id)
.List(), "NHibernate HQL"); .List(), "NHibernate HQL");
// bltoolkit
var db1 = new DbManager(Program.GetOpenConnection());
tests.Add(id => db1.SetCommand("select * from Posts where Id = @id", db1.Parameter("id", id)).ExecuteList<Post>(), "BLToolkit");
// HAND CODED // HAND CODED
......
...@@ -35,6 +35,9 @@ ...@@ -35,6 +35,9 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="BLToolkit.4">
<HintPath>bltoolkit\BLToolkit.4.dll</HintPath>
</Reference>
<Reference Include="Iesi.Collections"> <Reference Include="Iesi.Collections">
<HintPath>NHibernate\Iesi.Collections.dll</HintPath> <HintPath>NHibernate\Iesi.Collections.dll</HintPath>
</Reference> </Reference>
...@@ -156,6 +159,9 @@ ...@@ -156,6 +159,9 @@
<Content Include="NHibernate\hibernate.cfg.xml" /> <Content Include="NHibernate\hibernate.cfg.xml" />
<Content Include="NHibernate\Post.hbm.xml" /> <Content Include="NHibernate\Post.hbm.xml" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="bltoolkit\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment