This commit is contained in:
sunkaixuan 2017-09-21 14:38:40 +08:00
parent 05819eb304
commit 3f96bf2048
3 changed files with 25 additions and 26 deletions

View File

@ -11,25 +11,26 @@ namespace PerformanceTest.TestItems
{
public class TestGetAll
{
public void Init()
public void Init(OrmType type)
{
Console.WriteLine("测试一次读取100万条数据的速度");
var eachCount = 1;
Console.WriteLine("开启预热");
Dapper(1);
SqlSugar(1);
Console.WriteLine("预热完毕");
for (int i = 0; i < 10; i++)
{
//dapper
Dapper(eachCount);
//sqlSugar
SqlSugar(eachCount);
switch (type)
{
case OrmType.SqlSugar:
SqlSugar(eachCount);
break;
case OrmType.Dapper:
Dapper(eachCount);
break;
default:
break;
}
}
}
private static void SqlSugar(int eachCount)

View File

@ -12,25 +12,25 @@ namespace PerformanceTest.TestItems
public class TestGetById
{
public void Init()
public void Init(OrmType type)
{
Console.WriteLine("测试一次读取1条数据的速度");
var eachCount = 1000;
Console.WriteLine("开启预热");
Dapper(1);
SqlSugar(1);
Console.WriteLine("预热完毕");
for (int i = 0; i < 10; i++)
{
//dapper
Dapper(eachCount);
//sqlSugar
SqlSugar(eachCount);
switch (type)
{
case OrmType.SqlSugar:
SqlSugar(eachCount);
break;
case OrmType.Dapper:
Dapper(eachCount);
break;
default:
break;
}
}
}
private static void SqlSugar(int eachCount)

View File

@ -21,11 +21,9 @@ namespace PerformanceTest.TestItems
switch (type)
{
case OrmType.SqlSugar:
//sqlSugar
SqlSugar(eachCount);
break;
case OrmType.Dapper:
//dapper
Dapper(eachCount);
break;
}