核心数据 vs Sqlite 和性能 [英] Core Data vs Sqlite and performance

查看:23
本文介绍了核心数据 vs Sqlite 和性能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有人知道在 3.0 SDK 中已转换为 Core Data 的旧 sqlite 应用程序之间的性能差异的真实数据.

I am wondering if anyone has any real world numbers on performance differences between an old sqlite application which has been converted to Core Data in the 3.0 SDK.

我怀疑核心数据无论如何都只是在使用 sqlite 并且为了方便而增加了一些开销,但我想我还是会问.

I suspect that under the hood Core Data is just using sqlite anyways and that it add's a bit of overhead for the cost of convenience, but i thought i would ask anyways.

推荐答案

Core Data 在缓存、延迟加载和内存管理方面进行了大量优化.

Core Data is heavily optimized with regards to caching, lazy-loading and memory management.

如果您使用它(使用 SQLite 存储类型),尤其是与 NSFetchedResultsController 结合使用,您应该获得比单独使用 SQLite 更好的性能.

If you use it (with the SQLite store type), especially in conjunction with NSFetchedResultsController, you should get better performance than you could get with SQLite on your own.

Apple 一直在努力使 Core Data 在 iPhone 上表现良好.我的应用程序从带 FMDB 的 SQLite 切换到 Core Data,现在速度更快、更稳定,代码更少.

Apple has worked hard to make Core Data perform well on the iPhone. My application switched from SQLite w/ FMDB to Core Data and it is now faster and more stable with less code.

这篇关于核心数据 vs Sqlite 和性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆