pinterest / PINCache

Fast, non-deadlocking parallel object cache for iOS, tvOS and OS X
Apache License 2.0
2.66k stars 361 forks source link

Store metadata in alternative structure to increase initialization performance. #236

Open Quanhua-Guan opened 6 years ago

Quanhua-Guan commented 6 years ago

When more and more data cache in DiskCache, the startup can cost a lot of time, and before that we can not get data from disk cache.

Quanhua-Guan commented 6 years ago

Test on iPhone 8 Plus

Item count Cached | time used to init PINDiskCache

garrettmoon commented 5 years ago

@Quanhua-Guan the disk cache initializes asynchronously in part to address these issues, but you're right, there may be a way to increase startup performance by storing metadata in a different place – sadly this would require a major rewrite of the disk caching layer.