Thanks for the input. One follow-up question that I've seen one other ask in the Github issues, but not seen answered. Why are cached property values of CBLModels discarded on save?
One of the performance issues I've been running into is that I periodically save my CBLModels when my user leaves different view controllers. However, this invalidates all the currently accessed values for properties, and when I call the getters on these properties, recreating their values from the document is expensive. Is there a workaround for this? Cheers, Ragu On Sunday, May 4, 2014 11:32:38 AM UTC-7, Jens Alfke wrote: > > > On May 4, 2014, at 4:10 AM, Ragu Vijaykumar <[email protected]<javascript:>> > wrote: > > *I was wondering if there might be any bad side-effects if I were to > create an NSCache for my read-only CBLModels?* > > > That sounds reasonable. I don’t think there would be any bad side effects, > other than increased memory usage of course. CBLDatabase does something > similar, keeping an NSMutableSet of models with unsaved changes so they > won’t be dealloced before they can be saved. > > the models have strong pointers to the CBLDocuments, so as long as they > aren't dealloc'd, the documents won't be evicted from the cache. > > > Right. > > —Jens > -- You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/3fe7de31-a7a4-41fb-805d-d54d7faae16e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
