Add performance test

This commit is contained in:
sunkaixuan 2025-05-05 09:29:01 +08:00
parent f8190f25c6
commit 2b2add7e5a
2 changed files with 31 additions and 0 deletions

View File

@ -63,6 +63,20 @@ namespace OrmTest
//Delete //Delete
//删除 //删除
db.Deleteable(userInfo).ExecuteCommand(); db.Deleteable(userInfo).ExecuteCommand();
//Test the performance of creating SQL
for (int i = 0; i < 10000; i++)
{
db.Insertable(new UserInfo001()
{
Context = "Context",
Email = "dfafa@qq.com",
Price = Convert.ToDecimal(1.1),
UserName = "admin",
RegistrationDate = DateTime.Now,
}).ToSql();
}
} }
/// <summary> /// <summary>

View File

@ -180,6 +180,23 @@ CACHEMODEL 'both'");//不支持 UPDATE 1 选项
}).AS("fc_data01").ExecuteCommand(); }).AS("fc_data01").ExecuteCommand();
var list2 = db.Queryable<fc_data>().AS("fc_data01").ToList(); var list2 = db.Queryable<fc_data>().AS("fc_data01").ToList();
//Test the performance of creating SQL
for (int i = 0; i < 10000; i++)
{
db.Insertable(new fc_data()
{
data_id = 1,
gateway_mac = "mac",
rssi = 11,
ruminate = 1,
speed_hex = "x",
temperature = 1,
upload_time = DateTime.Now,
voltage = 1
}).ToSql();
}
} }
} }
} }