You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling this method, it unarchived all objects in the cache, which causes serious performance issue in my situation.
So in my cache, i have 3 keys, each map to an array of 1000 objects. Now to check which key is expired, it needs to unarchived all 3000 objects, which is seriously slow, and it doesn't make sense.
1 solution for this, is we store the timestamp (NSDate) for each key. So N keys will have N timestamps. Then when we need to check which key is expired, we only need to unarchived N NSDate objects, instead of all the objects that they keys are mapped to, which could be N*M
So if we have 1000 keys maps to 1000 objects, then the performance is the same. But if we have 3 keys maps to 3000 objects, then you can see that the performance is way better.
In my app, i also store the timestamps for each key, but then i cannot retrieve the keys, because function allKeys() is private. So right now i'm stuck.
The text was updated successfully, but these errors were encountered:
When calling this method, it unarchived all objects in the cache, which causes serious performance issue in my situation.
So in my cache, i have 3 keys, each map to an array of 1000 objects. Now to check which key is expired, it needs to unarchived all 3000 objects, which is seriously slow, and it doesn't make sense.
1 solution for this, is we store the timestamp (NSDate) for each key. So N keys will have N timestamps. Then when we need to check which key is expired, we only need to unarchived N NSDate objects, instead of all the objects that they keys are mapped to, which could be N*M
So if we have 1000 keys maps to 1000 objects, then the performance is the same. But if we have 3 keys maps to 3000 objects, then you can see that the performance is way better.
In my app, i also store the timestamps for each key, but then i cannot retrieve the keys, because function allKeys() is private. So right now i'm stuck.
The text was updated successfully, but these errors were encountered: