相关疑难解决方法(0)

核心数据性能:NSPredicate比较对象

如果我的Author NSManagedObject模型有一个authorID属性(由服务器确定),NSFetchRequest如果NSPredicate过滤器authorID而不是完整Author对象,那么效果会更好吗?让我们说我正在取得所有Book NSManagedObject的东西author.哪个predicateFormat更好?

[NSPredicate predicateWithFormat:@"author = %@", anAuthor]
Run Code Online (Sandbox Code Playgroud)

要么

[NSPredicate predicateWithFormat:@"author.authorID = %@", anAuthor.authorID]
Run Code Online (Sandbox Code Playgroud)

对此进行分析的最佳方式是什么?我使用OCUnit(SenTestingKit)进行核心数据测试.iOS有像Ruby的Benchmark模块吗?

profile performance core-data nspredicate nsfetchrequest

8
推荐指数
1
解决办法
3866
查看次数