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
I'm using a PINDiskCache to store roughly 1000 images when it reaches the disk cache limit specified.
After the cache reaches it's limit, it looks like nearly every call to -setObjectAsync:forKey:completion: to add an item to the cache triggers one -trimDiskToSizeByDate: call. This call sorts the _metadata array so the code ends up sorting this same array repeatedly.
We could mitigate the costs of this sorting by either throttling the trim to once every 60s (could be configurable), or by using a data structure like a priority queue. I could submit a Pull Request for configurable throttling of the trim if needed. thanks
The text was updated successfully, but these errors were encountered:
I'm using a PINDiskCache to store roughly 1000 images when it reaches the disk cache limit specified.
After the cache reaches it's limit, it looks like nearly every call to -setObjectAsync:forKey:completion: to add an item to the cache triggers one -trimDiskToSizeByDate: call. This call sorts the _metadata array so the code ends up sorting this same array repeatedly.
We could mitigate the costs of this sorting by either throttling the trim to once every 60s (could be configurable), or by using a data structure like a priority queue. I could submit a Pull Request for configurable throttling of the trim if needed. thanks
The text was updated successfully, but these errors were encountered: