twitter / ios-twitter-image-pipeline

Twitter Image Pipeline is a robust and performant image loading and caching framework for iOS clients
Apache License 2.0
1.85k stars 109 forks source link

why rendered cache? #20

Closed yjh1313 closed 7 years ago

yjh1313 commented 7 years ago

Acctually the images from the rendered cached are similar to the ones from memory cached, So I want to know if this will cost lots of memory.

NSProgrammer commented 7 years ago

Both the memory cache and renders cache have limits to how large they can be, so the memory usage will be capped.

The rendered cache has prescaled and decoded images so that they can be synchronously accessed and displayed without impacting the main thread performance.

The memory cache has the same image as in the disk cache, and might not be decoded meaning accessing it could (but might not always) yield expensive decoding and scaling which TIP keeps off the main thread.

True - in concept they are similar. Both are in memory caches. However, for performance reasons, the rendered cache is most critical. If the value of two caches is not apparent, you should be able to disable the memory cache and things will continue to work.