Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when I insert 1000 datas ? #148

Open
wwwang89 opened this issue Jul 10, 2017 · 2 comments
Open

when I insert 1000 datas ? #148

wwwang89 opened this issue Jul 10, 2017 · 2 comments

Comments

@wwwang89
Copy link

  • (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~

@Wayxq
Copy link

Wayxq commented Jun 21, 2018

+1

@pieterclaerhout
Copy link

See #18 and #91

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants