提交 c1319217 编写于 作者: A andrex

Added benchmarks for bltoolkit

上级 7535cb7d
/*.suo
bin/*
obj/*
\ No newline at end of file
obj/*
/*.user
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using BLToolkit.Data;
using SqlMapper.Linq2Sql;
using System.Data.Linq;
using System.Diagnostics;
......@@ -13,7 +13,6 @@ namespace SqlMapper
{
class PerformanceTests
{
class Test
{
public static Test Create(Action<int> iteration, string name)
......@@ -126,12 +125,14 @@ public void Run(int iterations)
.SetInt32("id", id)
.List(), "NHibernate SQL");
var nhSession2 = NHibernateHelper.OpenSession();
tests.Add(id => nhSession2.CreateQuery(@"from Post as p where p.Id = :id")
.SetInt32("id", id)
.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
......
......@@ -35,6 +35,9 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="BLToolkit.4">
<HintPath>bltoolkit\BLToolkit.4.dll</HintPath>
</Reference>
<Reference Include="Iesi.Collections">
<HintPath>NHibernate\Iesi.Collections.dll</HintPath>
</Reference>
......@@ -156,6 +159,9 @@
<Content Include="NHibernate\hibernate.cfg.xml" />
<Content Include="NHibernate\Post.hbm.xml" />
</ItemGroup>
<ItemGroup>
<Folder Include="bltoolkit\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- 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.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册