-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PINCache] Set a default .byteLimit to reduce disk usage & startup time. #595
Conversation
This default is fairly low - only 20MB - but for most apps with images in the size range of 10-50KB, this is still 400-1000 images. Once some optimizations land to PINCache, we'll match the PINCache default of 50MB to ensure the default better serves users with larger objects in the cache. Apps should preferably set their own byteLimit to an optimal value. @garrettmoon - one interesting question for us is the best place to set .byteLimit as an app. Digging into the ASPINRemoteImageDownloader and doing this type cast is a bit complicated, so a passthrough API to get the PIN* objects directly might be worthwhile.
🚫 CI failed with log |
@appleguy Yeah, that's a good idea, but I don't want to get all my Hacktoberfest PRs done in one day :P |
|
||
// Set a default byteLimit. PINCache recently implemented a 50MB default (PR #201). | ||
// Ensure that older versions of PINCache also have a byteLimit applied. | ||
PINDiskCache *diskCache = [ASDynamicCast(cache, PINCache) diskCache]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to add a <PINCache/PINCache.h> include at the top.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But LGTM once the build passes.
Thanks! Looking into the right way to either reference, or avoid referencing PINCache as a symbol. |
🚫 CI failed with log |
b63fc1e
to
596521e
Compare
@garrettmoon FYI, it looks like this test failure is spurious - it doesn't reproduce on my local machine, this patch isn't related, and it will probably pass upon retry. Had to do a fake commit change to poke the server.
|
I had the same issue in a previous PR opened a couple of days ago. I had to manually retry the CI and the next time it finished successfully. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…me. (TextureGroup#595) * [PINCache] Set a default .byteLimit to reduce disk usage & startup time. This default is fairly low - only 20MB - but for most apps with images in the size range of 10-50KB, this is still 400-1000 images. Once some optimizations land to PINCache, we'll match the PINCache default of 50MB to ensure the default better serves users with larger objects in the cache. Apps should preferably set their own byteLimit to an optimal value. @garrettmoon - one interesting question for us is the best place to set .byteLimit as an app. Digging into the ASPINRemoteImageDownloader and doing this type cast is a bit complicated, so a passthrough API to get the PIN* objects directly might be worthwhile. * [PINCache] Declare necessary APIs to avoid a direct dependency.
This default is fairly low - only 20MB - but for most apps with images
in the size range of 10-50KB, this is still 400-1000 images.
Once some optimizations land to PINCache, we'll match the PINCache
default of 50MB to ensure the default better serves users with larger
objects in the cache.
Apps should preferably set their own byteLimit to an optimal value.
@garrettmoon - one interesting question for us is the best place to
set .byteLimit as an app. Digging into the ASPINRemoteImageDownloader
and doing this type cast is a bit complicated, so a passthrough API
to get the PIN* objects directly might be worthwhile.