FCModel icon indicating copy to clipboard operation
FCModel copied to clipboard

when I insert 1000 datas ?

Open wwwang89 opened this issue 8 years ago • 2 comments

  • (void)insertObj { // Put some data in the table if there's not enough NSArray *allColors = [Color allInstances]; NSUInteger numPeople = [Person numberOfInstances]; NSTimeInterval date1 = [NSDate.date timeIntervalSince1970]; NSLog(@"date1:%f",date1); while (numPeople < 1000) { Person *p = [Person new]; [p save:^{ p.name = [@"xiaohong" stringByAppendingString:[@(numPeople) stringValue]];//[RandomThings randomName]; NSInteger num = numPeople; if (num >= allColors.count) { num = arc4random() % allColors.count; } Color *color = allColors[num]; p.color = color; }];

      numPeople++;
    

    } NSLog(@"date2:%f",[NSDate.date timeIntervalSince1970]); }

the output result : 2017-07-10 15:13:43.624140 FCModelTest[14829:3666710] date1:1499670823.624041 2017-07-10 15:13:58.527835 FCModelTest[14829:3666710] date2:1499670838.527774

so it takes about 15s when I save 1000 datas, Is there anything wrong ?thanks for help~

wwwang89 avatar Jul 10 '17 07:07 wwwang89

+1

Wayxq avatar Jun 21 '18 10:06 Wayxq

See #18 and #91

pieterclaerhout avatar Aug 21 '18 06:08 pieterclaerhout