我试图从mylist到数据库插入数千个数据,需要很长时间来保存每个数据.
有没有办法改善保存性能?
for (int j = 0; j < listPeople.size(); j++) {
Person people= listPeople.get(j);
people.save();}
Log
11-27 04:15:06.991 10268-10268/com.testall I/Sugar? Person saved : 1
11-27 04:15:07.991 10268-10268/com.testall I/Sugar? Person saved : .......
11-27 04:16:08.991 10268-10268/com.testall I/Sugar? Person saved : 1000
Run Code Online (Sandbox Code Playgroud)