Core Data Performance with Single Parent Entity

前端 未结 3 1115
暖寄归人
暖寄归人 2020-11-29 22:31

I am creating a framework that works with Core Data. One of the requirements for using my framework on your Core Data class is that any entity you want to have the Framework

3条回答
  •  执笔经年
    2020-11-29 23:21

    Last year I worked on a project that did the same thing, we stored everything in core data and everything in core data inherited from a single class which had some common attributes.

    We had somewhere between 1k - 10k records in core data and performance degraded to the point where we rewrote it and removed the common ancestor. As I recall simple searches were taking multiple seconds, and insertions / updates were pretty crappy too. It was only after things had gotten painfully slow that we cracked the db open and noticed under the covers core data was storing everything in one table.

    Sorry I don't remember specific numbers, the big takeaway was we had to redo it because it was too slow, and not too slow like too slow for high frequency trading but too slow like the app crashed on load when trying to populate the initial view out of core data.

    So, with the grain of salt that this was on older iOS and older hardware, I would say definitely do not do this.

提交回复
热议问题