这两天在测试数据库的性能时发现,更新非常慢,但是如果直接执行sql,不通过jfinal,可以每秒大概4000条,用jfinal大概只有每秒20条,代码如下:
int i;
Clock baseclock = Clock.systemUTC();
// get instant of base class and print instant
Instant instant = baseclock.instant();
System.out.println("Instant of Base 1 class "
+ instant);
for(i=1;i<200;i++) {
new User().set("name","usera").set("school","schoola").save();
}
Instant instant1 = baseclock.instant();
System.out.println("Instant of Base 2 class "
+ instant1);
打印输出如下:
Before invoking /blog/test_call
Instant of Base 1 class 2020-10-03T16:30:10.793Z
Instant of Base 2 class 2020-10-03T16:30:20.401Z
After invoking /blog/test_call
单表增加200条记录,执行了10秒钟。有大神可以给答复一下么?
项目:JFinal