Skip to content

Reduce memory usage peak when using thumbnail animated WebP decoding and encoding #73

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

Merged
merged 3 commits into from
Mar 16, 2023

Conversation

dreampiggy
Copy link
Contributor

  1. Use CoreGraphics to avoid extra vImage convert and allocate of decoded thumbnail image buffer
  2. Use kvImageNoAllocate to avoi extra vImage to allocate 1x memory buffer (x means the input source image buffer)

See more in : SDWebImage/SDWebImage#3508

…full context and re-scale after decode finished

This can help to avoid memory allocation

For encoding, avoid using vImageConvert_AnyToAny and just use it convenience method instead
@dreampiggy
Copy link
Contributor Author

Tested by user in production app, has benefit on memory and reduce peak.

Due to the changes may effect the visible of thumbnail (because previously is actually a high-resolution and down-scale, now is directly thumbnail), it need the minor version update

@dreampiggy dreampiggy merged commit 9082448 into master Mar 16, 2023
@dreampiggy dreampiggy deleted the perf/awebp_thumbnail_allocation branch March 16, 2023 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant