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

Only sort accessDates if totalCost exceeds costLimit #315

Closed kchronis closed 1 year ago

kchronis commented 1 year ago

As the number of cached objects increases, sorting the accessDates becomes expensive. The access dates should only be sorted if the totalCost is greater than the limit.